summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-03-10 16:51:41 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2023-03-10 16:53:07 -0800
commitc6bfffa9fe1af7f4f806e5533ba5f3c33476cf9a (patch)
tree444e6a5ada6a746274541ac6cda6b1cc2795a442 /lib
parentd236ab09300070696f21ebfda49678b11c2327eb (diff)
downloademacs-c6bfffa9fe1af7f4f806e5533ba5f3c33476cf9a.tar.gz
Update from Gnulib by running admin/merge-gnulib
Run admin/merge-gnulib along with the following change: * admin/merge-gnulib (GNULIB_MODULES): Replace ‘time’ with ‘time-h’, adjusting to a recent renaming in Gnulib modules. Emacs doesn’t appear to need the new Gnulib ‘time’ module.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk.in12
-rw-r--r--lib/stdio.in.h11
-rw-r--r--lib/time.in.h14
3 files changed, 33 insertions, 4 deletions
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 53a821b141e..47d08a5e27f 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -156,7 +156,7 @@
# sys_stat \
# sys_time \
# tempname \
-# time \
+# time-h \
# time_r \
# time_rz \
# timegm \
@@ -595,6 +595,7 @@ GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TIME = @GL_GNULIB_TIME@
GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
@@ -1209,6 +1210,7 @@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TIME = @REPLACE_TIME@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TIMESPEC_GET = @REPLACE_TIMESPEC_GET@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
@@ -3723,8 +3725,8 @@ EXTRA_DIST += tempname.h
endif
## end gnulib module tempname
-## begin gnulib module time
-ifeq (,$(OMIT_GNULIB_MODULE_time))
+## begin gnulib module time-h
+ifeq (,$(OMIT_GNULIB_MODULE_time-h))
BUILT_SOURCES += time.h
@@ -3743,6 +3745,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIME''@/$(GL_GNULIB_TIME)/g' \
-e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
-e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
-e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
@@ -3764,6 +3767,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -e 's|@''REPLACE_TIME''@|$(REPLACE_TIME)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''REPLACE_TIMESPEC_GET''@|$(REPLACE_TIMESPEC_GET)|g' \
-e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
@@ -3782,7 +3786,7 @@ MOSTLYCLEANFILES += time.h time.h-t
EXTRA_DIST += time.in.h
endif
-## end gnulib module time
+## end gnulib module time-h
## begin gnulib module time_r
ifeq (,$(OMIT_GNULIB_MODULE_time_r))
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 3f8ea985335..098f841738c 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -36,6 +36,12 @@
#ifndef _@GUARD_PREFIX@_STDIO_H
+/* Suppress macOS deprecation warnings for sprintf and vsprintf. */
+#if (defined __APPLE__ && defined __MACH__) && !defined _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# define _GL_DEFINED__POSIX_C_SOURCE
+#endif
+
#define _GL_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */
@@ -43,6 +49,11 @@
#undef _GL_ALREADY_INCLUDING_STDIO_H
+#ifdef _GL_DEFINED__POSIX_C_SOURCE
+# undef _GL_DEFINED__POSIX_C_SOURCE
+# undef _POSIX_C_SOURCE
+#endif
+
#ifndef _@GUARD_PREFIX@_STDIO_H
#define _@GUARD_PREFIX@_STDIO_H
diff --git a/lib/time.in.h b/lib/time.in.h
index 87cda21413b..3f9af920e34 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -143,6 +143,20 @@ _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
_GL_CXXALIASWARN (timespec_getres);
# endif
+/* Return the number of seconds that have elapsed since the Epoch. */
+# if @GNULIB_TIME@
+# if @REPLACE_TIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define time rpl_time
+# endif
+_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp));
+_GL_CXXALIAS_RPL (time, time_t, (time_t *__tp));
+# else
+_GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
+# endif
+_GL_CXXALIASWARN (time);
+# endif
+
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */