changeset 39876:1f8e4f117a2b

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.
author Tom Tromey <tom@tromey.com>
date Mon, 01 Oct 2018 14:57:45 -0600
parents 67e1644a2382
children a8509dc053f1
files ChangeLog lib/stdlib.in.h
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 29 22:20:17 2018 -0700
+++ b/ChangeLog	Mon Oct 01 14:57:45 2018 -0600
@@ -1,3 +1,9 @@
+2018-10-01  Tom Tromey  <tom@tromey.com>
+
+	mkostemp, mkostemps: Fix compilation error in C++ mode on Mac OS X.
+	* lib/stdlib.in.h: Include <unistd.h> for mkostemp and mkostemps
+	on OS X.
+
 2018-09-30  Pádraig Brady  <P@draigBrady.com>
 
 	hmac-*: refactor to remove repetitive code
--- a/lib/stdlib.in.h	Sat Sep 29 22:20:17 2018 -0700
+++ b/lib/stdlib.in.h	Mon Oct 01 14:57:45 2018 -0600
@@ -90,9 +90,10 @@
 # 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>