]> Savannah Git Hosting - gnulib.git/commitdiff
stdlib: port to Solaris 2.6
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Jan 2013 20:32:05 +0000 (12:32 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 9 Jan 2013 22:59:28 +0000 (14:59 -0800)
Also, the code worked on Solaris 7 through 9 only by accident.
Problem reported by Tom G. Christensen in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00059.html>.
* lib/stdlib.in.h: If __need_system_stdlib_h is defined,
simply include the system stdlib.h.
* lib/getopt.in.h (__need_system_stdlib_h):
* lib/pthread.in.h (__need_system_stdlib_h):
* lib/unistd.in.h (__need_system_stdlib_h) [!__GLIBC__]:
Define when including <stdlib.h>, to avoid problems at least for
the pthread case on Solaris 2.6 and 7.  These .h files can get by
with the system stdlib.h.

ChangeLog
lib/getopt.in.h
lib/pthread.in.h
lib/stdlib.in.h
lib/unistd.in.h

index 573fc13cf23585fd9f9f14210e4be969c1ea2d16..3b34c930053048d33c11d2797809ee00b4cf390b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-01-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdlib: port to Solaris 2.6
+       Also, the code worked on Solaris 7 through 9 only by accident.
+       Problem reported by Tom G. Christensen in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00059.html>.
+       * lib/stdlib.in.h: If __need_system_stdlib_h is defined,
+       simply include the system stdlib.h.
+       * lib/getopt.in.h (__need_system_stdlib_h):
+       * lib/pthread.in.h (__need_system_stdlib_h):
+       * lib/unistd.in.h (__need_system_stdlib_h) [!__GLIBC__]:
+       Define when including <stdlib.h>, to avoid problems at least for
+       the pthread case on Solaris 2.6 and 7.  These .h files can get by
+       with the system stdlib.h.
+
 2013-01-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        doc: update main copyright year
index 490994f860f4301583c0071623dedffafc7bfa2c..d9c7d8144aea2af4580a6f0b6f9ce283176578bb 100644 (file)
@@ -49,7 +49,9 @@
    linkers.  */
 #if defined __GETOPT_PREFIX && !defined __need_getopt
 # if !@HAVE_GETOPT_H@
+#  define __need_system_stdlib_h
 #  include <stdlib.h>
+#  undef __need_system_stdlib_h
 #  include <stdio.h>
 #  include <unistd.h>
 # endif
index 1a4f1fc5874aea7bcd205912ea44a7c73b2d0c2f..7fcfb0b3b64113081ea3ef9e5e58c5ce8cfa7e2f 100644 (file)
 #ifndef _@GUARD_PREFIX@_PTHREAD_H_
 #define _@GUARD_PREFIX@_PTHREAD_H_
 
-#include <errno.h>
+#define __need_system_stdlib_h
 #include <stdlib.h>
+#undef __need_system_stdlib_h
+
+#include <errno.h>
 #include <sched.h>
 #include <sys/types.h>
 #include <time.h>
index 3b3b4b1bd437f296dad69a405339376546aa4bad..422ad714c32e6c9fca879e488b9dc8cd9f323c78 100644 (file)
@@ -20,8 +20,9 @@
 #endif
 @PRAGMA_COLUMNS@
 
-#if defined __need_malloc_and_calloc
-/* Special invocation convention inside glibc header files.  */
+#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+/* Special invocation conventions inside some gnulib header files,
+   and inside some glibc header files, respectively.  */
 
 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
 
index bc259dbb7899cd1aff63e360459faf4fe8c40769..373bf916de09ee2c9f9ed3357ce276ec1fd94269 100644 (file)
@@ -79,7 +79,9 @@
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #ifndef __GLIBC__
+# define __need_system_stdlib_h
 # include <stdlib.h>
+# undef __need_system_stdlib_h
 #endif
 
 /* Native Windows platforms declare chdir, getcwd, rmdir in