Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b45f048

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 16bbe5a commit b45f048

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/include/port.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ extern int getpeereid(int sock, uid_t *uid, gid_t *gid);
390390
extern int isinf(double x);
391391
#endif
392392

393+
#ifndef HAVE_MKDTEMP
394+
extern char *mkdtemp(char *path);
395+
#endif
396+
393397
#ifndef HAVE_RINT
394398
extern double rint(double x);
395399
#endif
@@ -466,9 +470,6 @@ extern int pg_check_dir(const char *dir);
466470
/* port/pgmkdirp.c */
467471
extern int pg_mkdir_p(char *path, int omode);
468472

469-
/* port/mkdtemp.c */
470-
extern char *mkdtemp(char *path);
471-
472473
/* port/pqsignal.c */
473474
typedef void (*pqsigfunc) (int signo);
474475
extern pqsigfunc pqsignal(int signo, pqsigfunc func);

0 commit comments

Comments
 (0)