summaryrefslogtreecommitdiff
path: root/lib/time.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/time.in.h')
-rw-r--r--lib/time.in.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/time.in.h b/lib/time.in.h
index 3ff16e3b..5bbccf76 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2025 Free Software Foundation, Inc.
+ Copyright (C) 2007-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -161,7 +161,6 @@ _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
_GL_CXXALIASWARN (timespec_get);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef timespec_get
# if HAVE_RAW_DECL_TIMESPEC_GET
_GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - "
"use gnulib module timespec_get for portability");
@@ -190,7 +189,6 @@ _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
_GL_CXXALIASWARN (timespec_getres);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef timespec_getres
# if HAVE_RAW_DECL_TIMESPEC_GETRES
_GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - "
"use gnulib module timespec_getres for portability");
@@ -212,7 +210,6 @@ _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
_GL_CXXALIASWARN (time);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef time
# if HAVE_RAW_DECL_TIME
_GL_WARN_ON_USE (time, "time has consistency problems - "
"use gnulib module time for portability");
@@ -243,7 +240,6 @@ _GL_CXXALIAS_SYS (nanosleep, int,
# endif
_GL_CXXALIASWARN (nanosleep);
# elif defined GNULIB_POSIXCHECK
-# undef nanosleep
# if HAVE_RAW_DECL_NANOSLEEP
_GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - "
"use gnulib module nanosleep for portability");
@@ -284,7 +280,6 @@ _GL_CXXALIAS_SYS (tzset, void, (void));
# endif
_GL_CXXALIASWARN (tzset);
# elif defined GNULIB_POSIXCHECK
-# undef tzset
# if HAVE_RAW_DECL_TZSET
_GL_WARN_ON_USE (tzset, "tzset has portability problems - "
"use gnulib module tzset for portability");
@@ -306,7 +301,6 @@ _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
_GL_CXXALIASWARN (mktime);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef mktime
# if HAVE_RAW_DECL_MKTIME
_GL_WARN_ON_USE (mktime, "mktime has portability problems - "
"use gnulib module mktime for portability");
@@ -362,12 +356,10 @@ _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
_GL_CXXALIASWARN (gmtime_r);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef localtime_r
# if HAVE_RAW_DECL_LOCALTIME_R
_GL_WARN_ON_USE (localtime_r, "localtime_r is unportable - "
"use gnulib module time_r for portability");
# endif
-# undef gmtime_r
# if HAVE_RAW_DECL_GMTIME_R
_GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - "
"use gnulib module time_r for portability");
@@ -393,7 +385,6 @@ _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
_GL_CXXALIASWARN (localtime);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef localtime
# if HAVE_RAW_DECL_LOCALTIME
_GL_WARN_ON_USE (localtime, "localtime has portability problems - "
"use gnulib module localtime for portability");
@@ -430,7 +421,6 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
struct tm *restrict __tm));
_GL_CXXALIASWARN (strptime);
# elif defined GNULIB_POSIXCHECK
-# undef strptime
# if HAVE_RAW_DECL_STRPTIME
_GL_WARN_ON_USE (strptime, "strptime is unportable - "
"use gnulib module strptime for portability");
@@ -483,7 +473,6 @@ _GL_CXXALIAS_SYS (strftime, size_t,
_GL_CXXALIASWARN (strftime);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef strftime
# if HAVE_RAW_DECL_STRFTIME
_GL_WARN_ON_USE (strftime, "strftime has portability problems - "
"use gnulib module strftime-fixes for portability");
@@ -523,11 +512,18 @@ _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
# endif
/* tzfree (tz)
- Frees a time zone object.
+ Free a time zone object, preserving errno.
The argument must have been returned by tzalloc(). */
# if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), );
_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzfree
+# define tzfree rpl_tzfree
+# endif
+_GL_FUNCDECL_RPL (tzfree, void, (timezone_t __tz), );
+_GL_CXXALIAS_RPL (tzfree, void, (timezone_t __tz));
# endif
/* localtime_rz (tz, &t, &result)
@@ -611,7 +607,6 @@ _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
_GL_CXXALIASWARN (timegm);
# endif
# elif defined GNULIB_POSIXCHECK
-# undef timegm
# if HAVE_RAW_DECL_TIMEGM
_GL_WARN_ON_USE (timegm, "timegm is unportable - "
"use gnulib module timegm for portability");
@@ -622,28 +617,24 @@ _GL_WARN_ON_USE (timegm, "timegm is unportable - "
buffers when given outlandish struct tm values. Portable
applications should use strftime (or even sprintf) instead. */
# if defined GNULIB_POSIXCHECK
-# undef asctime
# if HAVE_RAW_DECL_ASCTIME
_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef asctime_r
# if HAVE_RAW_DECL_ASCTIME_R
_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef ctime
# if HAVE_RAW_DECL_CTIME
_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
# endif
# endif
# if defined GNULIB_POSIXCHECK
-# undef ctime_r
# if HAVE_RAW_DECL_CTIME_R
_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");