Mercurial > gnulib
diff lib/sys_select.in.h @ 17303:0e38241a3d05
sys_time: port to Solaris 2.6
There is a circularity problem on Solaris 2.6, where <time.h> includes
<sys/time.h> for struct timespec. The include nesting is gnulib
<time.h>, system <time.h>, gnulib <sys/time.h>, system
<sys/time.h>, gnulib <sys/types.h>, system <sys/types.h>, gnulib
<sys/select.h>, gnulib <signal.h>, system <sys/signal.h>, system
<sys/siginfo.h>; the last, innermost file needs struct
timestruc_t, which is defined in <sys/time.h>, which has not been
fully parsed. Problem reported by Tom G. Christensen in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00113.html>.
* lib/sys_select.in.h: Treat Solaris 2.6's problem with
<sys/time.h> and <sys/types.h> like OSF/1's similar problem.
* lib/sys_time.in.h: Redo to resemble sys_select.in.h, which
uses split double-inclusion guards.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 30 Jan 2013 21:26:44 -0800 |
parents | e542fd46ad6f |
children | 5a51fb7777a9 |
line wrap: on
line diff
--- a/lib/sys_select.in.h Tue Jan 29 22:34:58 2013 -0800 +++ b/lib/sys_select.in.h Wed Jan 30 21:26:44 2013 -0800 @@ -19,14 +19,25 @@ # endif @PRAGMA_COLUMNS@ -/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>. +/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h> + both include <sys/select.h>. Simply delegate to the system's header in this case. */ -#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE +#if (@HAVE_SYS_SELECT_H@ \ + && ((defined __osf__ && defined _SYS_TYPES_H_ && defined _OSF_SOURCE) \ + || (defined __sun && defined _SYS_TYPES_H \ + && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ + || defined __EXTENSIONS__))) \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ -#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE +#elif (@HAVE_SYS_SELECT_H@ \ + && ((defined __osf__ && defined _SYS_TIME_H_ && defined _OSF_SOURCE) \ + || (defined __sun && defined _SYS_TIME_H \ + && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \ + || defined __EXTENSIONS__))) \ + && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@