summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-04-14 12:52:25 +0200
committerBruno Haible <bruno@clisp.org>2023-04-14 12:52:25 +0200
commit97c4d3318909ba49003e12cac208ac40581dd4ae (patch)
tree960d6cc4c9e3704af5e7085f725b91a23b386ef7 /lib
parent09596027f260ff0de0e9932b88b90e0d06c71b6f (diff)
downloadgnulib-97c4d3318909ba49003e12cac208ac40581dd4ae.tar.gz
year2038: Add reminder to include <config.h> before time_t gets defined.
* lib/sched.in.h: Check that config.h was already included before the * lib/sys_select.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_time.in.h: Likewise. * lib/sys_types.in.h: Likewise. * lib/time.in.h: Likewise. * lib/utime.in.h: Likewise. * modules/year2038 (Depends-on): Add sched, sys_msg, sys_select, sys_sem, sys_shm, sys_stat, sys_time, sys_types, time-h, utime-h.
Diffstat (limited to 'lib')
-rw-r--r--lib/sched.in.h7
-rw-r--r--lib/sys_select.in.h7
-rw-r--r--lib/sys_stat.in.h7
-rw-r--r--lib/sys_time.in.h7
-rw-r--r--lib/sys_types.in.h7
-rw-r--r--lib/time.in.h7
-rw-r--r--lib/utime.in.h7
7 files changed, 49 insertions, 0 deletions
diff --git a/lib/sched.in.h b/lib/sched.in.h
index 1f9d0d219a..21aab51938 100644
--- a/lib/sched.in.h
+++ b/lib/sched.in.h
@@ -21,6 +21,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_SCHED_H@
# if @HAVE_SYS_CDEFS_H@
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index ce57c7573a..3abfc48af0 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -19,6 +19,13 @@
# endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
both include <sys/select.h>.
On Cygwin and OpenBSD, <sys/time.h> includes <sys/select.h>.
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 96bad04e3f..ad4da17fa4 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -25,6 +25,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if defined __need_system_sys_stat_h
/* Special invocation convention. */
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 5eb6173267..59cce1440d 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -24,6 +24,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* On Cygwin and on many BSDish systems, <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.
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index 082a6c674d..ea77e140be 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -20,6 +20,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if defined _WIN32 && !defined __CYGWIN__ \
&& (defined __need_off_t || defined __need___off64_t \
|| defined __need_ssize_t || defined __need_time_t)
diff --git a/lib/time.in.h b/lib/time.in.h
index 60e31897e4..84cb1fa933 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -20,6 +20,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* Don't get in the way of glibc when it includes time.h merely to
declare a few standard symbols, rather than to declare all the
symbols. (However, skip this for MinGW as it treats __need_time_t
diff --git a/lib/utime.in.h b/lib/utime.in.h
index eeb485d495..da49169748 100644
--- a/lib/utime.in.h
+++ b/lib/utime.in.h
@@ -21,6 +21,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_UTIME_H@
# @INCLUDE_NEXT@ @NEXT_UTIME_H@