summaryrefslogtreecommitdiff
path: root/lib/stdlib.in.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-10-01 14:57:45 -0600
committerBruno Haible <bruno@clisp.org>2018-10-02 01:14:11 +0200
commit6954995dd32ea98a1973df31f411f3996bb47dfb (patch)
treeefe5e1167ca5c8dc206d992bc100d543997c8990 /lib/stdlib.in.h
parent7d0bb7b0e50dbd631f7b0f3cf2718bcdf06e0506 (diff)
downloadgnulib-6954995dd32ea98a1973df31f411f3996bb47dfb.tar.gz
mkostemp, mkostemps: Fix compilation error in C++ mode on Mac OS X.
Attempting to use the mkostemp module in gdb caused a build failure when using the C++ namespace feature, because mkostemp was not declared. On OS X, mkostemp is declared in unistd.h, so this patch extends the existing special case in stdlib.in.h to cover mkostemp and mkostemps. * lib/stdlib.in.h: Include <unistd.h> for mkostemp and mkostemps on OS X.
Diffstat (limited to 'lib/stdlib.in.h')
-rw-r--r--lib/stdlib.in.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 3bf35bf6b0..441c018ec1 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -90,9 +90,10 @@ struct random_data
# endif
#endif
-#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
+/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
/* But avoid namespace pollution on glibc systems and native Windows. */
# include <unistd.h>