changeset 8459:530f0ba2b795

Ensure we get the mkstemp() declaration. On MacOS X, it comes from <unistd.h>.
author Bruno Haible <bruno@clisp.org>
date Sat, 17 Mar 2007 19:02:51 +0000
parents acda26672e61
children f4f4d8529d8b
files ChangeLog lib/stdlib_.h modules/stdlib
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-17  Bruno Haible  <bruno@clisp.org>
+
+	* modules/stdlib (Depends-on): Add unistd.
+	* lib/stdlib_.h: Include <unistd.h> if mkstemp is desired.
+	Needed for MacOS X 10.3.
+
 2007-03-17  Bruno Haible  <bruno@clisp.org>
 
 	* lib/unistr/u-strdup.h: Include <stdlib.h>.
--- a/lib/stdlib_.h
+++ b/lib/stdlib_.h
@@ -120,6 +120,9 @@
    set.  */
 #  define mkstemp rpl_mkstemp
 extern int mkstemp (char *template);
+# else
+/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+#  include <unistd.h>
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemp
--- a/modules/stdlib
+++ b/modules/stdlib
@@ -8,6 +8,7 @@
 Depends-on:
 absolute-header
 link-warning
+unistd
 
 configure.ac:
 gl_STDLIB_H