summaryrefslogtreecommitdiff
path: root/lib/sys_time.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-03-19 09:08:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-03-22 08:48:33 -0700
commit34f84640cd015eee3d9aed3b1eddf6f361576890 (patch)
tree9faece0b31ded743ca29067b6196a2927839360b /lib/sys_time.in.h
parentdb9cad7b8b59a010ff9158513a29cb002a2b8ae1 (diff)
downloadgnulib-34f84640cd015eee3d9aed3b1eddf6f361576890.tar.gz
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
Diffstat (limited to 'lib/sys_time.in.h')
-rw-r--r--lib/sys_time.in.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 1e6392d92c..09c9601e43 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -24,6 +24,14 @@
#endif
@PRAGMA_COLUMNS@
+/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
+ Simply delegate to the system's header in this case; it is a no-op.
+ Without this extra ifdef, the C++ gettimeofday declaration below
+ would be a forward declaration in gnulib's nested <sys/time.h>. */
+#ifdef _CYGWIN_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#else
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_SYS_TIME_H@
# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
@@ -200,4 +208,5 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
#endif
#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
+#endif /* _CYGWIN_SYS_TIME_H */
#endif /* _@GUARD_PREFIX@_SYS_TIME_H */