aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-10-17 22:55:33 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-10-17 22:55:33 -0400
commit28e9ebb9999c33680acafef5ece33b27e0f9ba3f (patch)
treeaf6b22516be319f7766ccc5dd14ef1c0e8e132e4 /src
parent96139cfbbc1581d6f17b601b37ce9dda88d36322 (diff)
downloadpostgresql-28e9ebb9999c33680acafef5ece33b27e0f9ba3f.tar.gz
postgresql-28e9ebb9999c33680acafef5ece33b27e0f9ba3f.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/include/port.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/port.h b/src/include/port.h
index 2dd50c9478b..1540771db9a 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -426,6 +426,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
@@ -497,7 +501,4 @@ 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);
-
#endif /* PG_PORT_H */