# HG changeset patch # User Paul Eggert # Date 1357677125 28800 # Node ID b83fbc95abc4471641312f3707c03ffc64233903 # Parent ba79ea8176b55746212815852531a4cf7d232f8c 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 . * 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 , 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. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2013-01-09 Paul Eggert + + 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 + . + * 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 , 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 doc: update main copyright year diff --git a/lib/getopt.in.h b/lib/getopt.in.h --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -49,7 +49,9 @@ linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # if !@HAVE_GETOPT_H@ +# define __need_system_stdlib_h # include +# undef __need_system_stdlib_h # include # include # endif diff --git a/lib/pthread.in.h b/lib/pthread.in.h --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -32,8 +32,11 @@ #ifndef _@GUARD_PREFIX@_PTHREAD_H_ #define _@GUARD_PREFIX@_PTHREAD_H_ +#define __need_system_stdlib_h +#include +#undef __need_system_stdlib_h + #include -#include #include #include #include diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -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@ diff --git a/lib/unistd.in.h b/lib/unistd.in.h --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -79,7 +79,9 @@ /* Solaris declares getcwd not only in but also in . */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ +# define __need_system_stdlib_h # include +# undef __need_system_stdlib_h #endif /* Native Windows platforms declare chdir, getcwd, rmdir in