postgres.git / summary / log / commit / refs
commit 7804f350eef6b2603b7fced00d603352a1c5ff4b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat Oct 18 02:55:27 2014 +0000
First released in: 9.5.0, 9.0.19, 9.1.15, 9.2.10, 9.3.6, 9.4.0
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.
src/include/port.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/include/port.h b/src/include/port.h
index c117a38f110..cdcc19a32c5 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -408,6 +408,10 @@ extern int getpeereid(int sock, uid_t *uid, gid_t *gid);
extern int isinf(double x);
#endif
+#ifndef HAVE_MKDTEMP
+extern char *mkdtemp(char *path);
+#endif
+
#ifndef HAVE_RINT
extern double rint(double x);
#endif
@@ -476,9 +480,6 @@ extern int pg_check_dir(const char *dir);
/* port/pgmkdirp.c */
extern int pg_mkdir_p(char *path, int omode);
-/* port/mkdtemp.c */
-extern char *mkdtemp(char *path);
-
/* port/pqsignal.c */
typedef void (*pqsigfunc) (int signo);
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
[parent: d4f5cf5ce510]