From: Tom Lane Date: Sat, 18 Oct 2014 02:55:36 +0000 (-0400) Subject: Declare mkdtemp() only if we're providing it. X-Git-Tag: REL9_0_19~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98170fa4650752f670f055c74190e924ed8b655e;p=thirdparty%2Fpostgresql.git Declare mkdtemp() only if we're providing it. Follow our usual style of providing an "extern" for a standard library function only when we're also providing the implementation. This avoids issues when the system headers declare the function slightly differently than we do, as noted by Caleb Welton. We might have to go to the extent of probing to see if the system headers declare the function, but let's not do that until it's demonstrated to be necessary. Oversight in commit 9e6b1bf258170e62dac555fc82ff0536dfe01d29. Back-patch to all supported branches, as that was. --- diff --git a/src/include/port.h b/src/include/port.h index af1bb5ccee6..35a50ccc395 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -403,6 +403,10 @@ extern int getopt(int nargc, char *const * nargv, const char *ostr); extern int isinf(double x); #endif +#ifndef HAVE_MKDTEMP +extern char *mkdtemp(char *path); +#endif + #ifndef HAVE_RINT extern double rint(double x); #endif @@ -464,7 +468,4 @@ extern void qsort_arg(void *base, size_t nel, size_t elsize, /* port/chklocale.c */ extern int pg_get_encoding_from_locale(const char *ctype); -/* port/mkdtemp.c */ -extern char *mkdtemp(char *path); - #endif /* PG_PORT_H */