bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mkstemps: ensure declaration


From: Bruno Haible
Subject: mkstemps: ensure declaration
Date: Thu, 28 Apr 2011 00:07:42 +0200
User-agent: KMail/1.9.9

On MacOS X 10.5, mkstemps is declared in <unistd.h>, not in <stdlib.h>. This
leads to a failure in a testdir created by
  $ ./gnulib-tool --create-testdir --dir=... --with-tests --with-c++-tests 
mkstemps

g++ -DHAVE_CONFIG_H -I.  -DGNULIB_STRICT_CHECKING=1 -I. -I. -I.. -I./.. 
-I../gllib -I./../gllib -Wall   -MT test-stdlib-c++.o -MD -MP -MF 
.deps/test-stdlib-c++.Tpo -c -o test-stdlib-c++.o test-stdlib-c++.cc
../gllib/stdlib.h:731: error: '::mkstemps' has not been declared
../gllib/stdlib.h:732: error: 'mkstemps' was not declared in this scope
../gllib/stdlib.h:732: error: invalid type in declaration before ';' token
make[4]: *** [test-stdlib-c++.o] Error 1

This fixes it:


2011-04-27  Bruno Haible  <address@hidden>

        mkstemps: Ensure declaration on MacOS X 10.5.
        * lib/stdlib.in.h: Include <unistd.h> when mkstemps is requested.
        * doc/glibc-functions/mkstemps.texi: Document header file problem on
        MacOS X.

--- lib/stdlib.in.h.orig        Thu Apr 28 00:05:19 2011
+++ lib/stdlib.in.h     Thu Apr 28 00:02:40 2011
@@ -81,8 +81,9 @@
 # endif
 #endif
 
-#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! 
defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined 
__CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined 
GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined 
__WIN32__) && ! defined __CYGWIN__)
 /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+/* On MacOS X 10.5, only <unistd.h> declares mkstemps.  */
 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
 /* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
--- doc/glibc-functions/mkstemps.texi.orig      Thu Apr 28 00:05:19 2011
+++ doc/glibc-functions/mkstemps.texi   Wed Apr 27 23:58:50 2011
@@ -10,6 +10,10 @@
 This function is missing on many non-glibc platforms:
 glibc 2.10, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin
 1.5.x, mingw, Interix 3.5, BeOS.
address@hidden
+This function is declared in @code{<unistd.h>} instead of @code{<stdlib.h>}
+on some platforms:
+MacOS X 10.5.
 @end itemize
 
 Portability problems not fixed by Gnulib:

-- 
In memoriam Marian Batko <http://pl.wikipedia.org/wiki/Marian_Batko>
<http://en.auschwitz.org.pl/m/index.php?Itemid=8&id=478&option=com_content&task=view>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]