Skip to content

Commit 98170fa

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 31021e7 commit 98170fa

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
@@ -403,6 +403,10 @@ extern int getopt(int nargc, char *const * nargv, const char *ostr);
403403
extern int isinf(double x);
404404
#endif
405405

406+
#ifndef HAVE_MKDTEMP
407+
extern char *mkdtemp(char *path);
408+
#endif
409+
406410
#ifndef HAVE_RINT
407411
extern double rint(double x);
408412
#endif
@@ -464,7 +468,4 @@ extern void qsort_arg(void *base, size_t nel, size_t elsize,
464468
/* port/chklocale.c */
465469
extern int pg_get_encoding_from_locale(const char *ctype);
466470

467-
/* port/mkdtemp.c */
468-
extern char *mkdtemp(char *path);
469-
470471
#endif /* PG_PORT_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy