Skip to content

Commit 3609c0d

Browse files
committed
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 9e6b1bf. Back-patch to all supported branches, as that was.
1 parent 6de1b53 commit 3609c0d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/include/port.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ extern int getpeereid(int sock, uid_t *uid, gid_t *gid);
408408
extern int isinf(double x);
409409
#endif
410410

411+
#ifndef HAVE_MKDTEMP
412+
extern char *mkdtemp(char *path);
413+
#endif
414+
411415
#ifndef HAVE_RINT
412416
extern double rint(double x);
413417
#endif
@@ -475,7 +479,4 @@ extern int pg_check_dir(const char *dir);
475479
/* port/pgmkdirp.c */
476480
extern int pg_mkdir_p(char *path, int omode);
477481

478-
/* port/mkdtemp.c */
479-
extern char *mkdtemp(char *path);
480-
481482
#endif /* PG_PORT_H */

0 commit comments

Comments
 (0)