diff options
Diffstat (limited to 'gl/time.in.h')
| -rw-r--r-- | gl/time.in.h | 116 |
1 files changed, 90 insertions, 26 deletions
diff --git a/gl/time.in.h b/gl/time.in.h index df99c8ab..3ff16e3b 100644 --- a/gl/time.in.h +++ b/gl/time.in.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* A more-standard <time.h>. | 1 | /* A more-standard <time.h>. |
| 2 | 2 | ||
| 3 | Copyright (C) 2007-2024 Free Software Foundation, Inc. | 3 | Copyright (C) 2007-2025 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is free software: you can redistribute it and/or modify | 5 | This file is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU Lesser General Public License as | 6 | it under the terms of the GNU Lesser General Public License as |
| @@ -122,6 +122,23 @@ struct __time_t_must_be_integral { | |||
| 122 | # endif | 122 | # endif |
| 123 | # endif | 123 | # endif |
| 124 | 124 | ||
| 125 | # if @GNULIB_TZNAME@ | ||
| 126 | /* tzname[0..1]: Abbreviated time zone names, set by the tzset() function. */ | ||
| 127 | # if NEED_DECL_TZNAME | ||
| 128 | extern | ||
| 129 | # ifdef __cplusplus | ||
| 130 | "C" | ||
| 131 | # endif | ||
| 132 | char *tzname[]; | ||
| 133 | # endif | ||
| 134 | # if defined _WIN32 && !defined __CYGWIN__ | ||
| 135 | /* On native Windows, map 'tzname' to '_tzname' etc., so that -loldnames is not | ||
| 136 | required. */ | ||
| 137 | # undef tzname | ||
| 138 | # define tzname _tzname | ||
| 139 | # endif | ||
| 140 | # endif | ||
| 141 | |||
| 125 | /* Set *TS to the current time, and return BASE. | 142 | /* Set *TS to the current time, and return BASE. |
| 126 | Upon failure, return 0. */ | 143 | Upon failure, return 0. */ |
| 127 | # if @GNULIB_TIMESPEC_GET@ | 144 | # if @GNULIB_TIMESPEC_GET@ |
| @@ -130,12 +147,12 @@ struct __time_t_must_be_integral { | |||
| 130 | # undef timespec_get | 147 | # undef timespec_get |
| 131 | # define timespec_get rpl_timespec_get | 148 | # define timespec_get rpl_timespec_get |
| 132 | # endif | 149 | # endif |
| 133 | _GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base) | 150 | _GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base), |
| 134 | _GL_ARG_NONNULL ((1))); | 151 | _GL_ARG_NONNULL ((1))); |
| 135 | _GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base)); | 152 | _GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base)); |
| 136 | # else | 153 | # else |
| 137 | # if !@HAVE_TIMESPEC_GET@ | 154 | # if !@HAVE_TIMESPEC_GET@ |
| 138 | _GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base) | 155 | _GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base), |
| 139 | _GL_ARG_NONNULL ((1))); | 156 | _GL_ARG_NONNULL ((1))); |
| 140 | # endif | 157 | # endif |
| 141 | _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); | 158 | _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); |
| @@ -159,17 +176,19 @@ _GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - " | |||
| 159 | # undef timespec_getres | 176 | # undef timespec_getres |
| 160 | # define timespec_getres rpl_timespec_getres | 177 | # define timespec_getres rpl_timespec_getres |
| 161 | # endif | 178 | # endif |
| 162 | _GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base) | 179 | _GL_FUNCDECL_RPL (timespec_getres, int, (struct timespec *ts, int base), |
| 163 | _GL_ARG_NONNULL ((1))); | 180 | _GL_ARG_NONNULL ((1))); |
| 164 | _GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base)); | 181 | _GL_CXXALIAS_RPL (timespec_getres, int, (struct timespec *ts, int base)); |
| 165 | # else | 182 | # else |
| 166 | # if !@HAVE_TIMESPEC_GETRES@ | 183 | # if !@HAVE_TIMESPEC_GETRES@ |
| 167 | _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base) | 184 | _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base), |
| 168 | _GL_ARG_NONNULL ((1))); | 185 | _GL_ARG_NONNULL ((1))); |
| 169 | # endif | 186 | # endif |
| 170 | _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); | 187 | _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); |
| 171 | # endif | 188 | # endif |
| 189 | # if __GLIBC__ >= 2 | ||
| 172 | _GL_CXXALIASWARN (timespec_getres); | 190 | _GL_CXXALIASWARN (timespec_getres); |
| 191 | # endif | ||
| 173 | # elif defined GNULIB_POSIXCHECK | 192 | # elif defined GNULIB_POSIXCHECK |
| 174 | # undef timespec_getres | 193 | # undef timespec_getres |
| 175 | # if HAVE_RAW_DECL_TIMESPEC_GETRES | 194 | # if HAVE_RAW_DECL_TIMESPEC_GETRES |
| @@ -184,7 +203,7 @@ _GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - " | |||
| 184 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 203 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 185 | # define time rpl_time | 204 | # define time rpl_time |
| 186 | # endif | 205 | # endif |
| 187 | _GL_FUNCDECL_RPL (time, time_t, (time_t *__tp)); | 206 | _GL_FUNCDECL_RPL (time, time_t, (time_t *__tp), ); |
| 188 | _GL_CXXALIAS_RPL (time, time_t, (time_t *__tp)); | 207 | _GL_CXXALIAS_RPL (time, time_t, (time_t *__tp)); |
| 189 | # else | 208 | # else |
| 190 | _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); | 209 | _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); |
| @@ -209,14 +228,14 @@ _GL_WARN_ON_USE (time, "time has consistency problems - " | |||
| 209 | # define nanosleep rpl_nanosleep | 228 | # define nanosleep rpl_nanosleep |
| 210 | # endif | 229 | # endif |
| 211 | _GL_FUNCDECL_RPL (nanosleep, int, | 230 | _GL_FUNCDECL_RPL (nanosleep, int, |
| 212 | (struct timespec const *__rqtp, struct timespec *__rmtp) | 231 | (struct timespec const *__rqtp, struct timespec *__rmtp), |
| 213 | _GL_ARG_NONNULL ((1))); | 232 | _GL_ARG_NONNULL ((1))); |
| 214 | _GL_CXXALIAS_RPL (nanosleep, int, | 233 | _GL_CXXALIAS_RPL (nanosleep, int, |
| 215 | (struct timespec const *__rqtp, struct timespec *__rmtp)); | 234 | (struct timespec const *__rqtp, struct timespec *__rmtp)); |
| 216 | # else | 235 | # else |
| 217 | # if ! @HAVE_NANOSLEEP@ | 236 | # if ! @HAVE_NANOSLEEP@ |
| 218 | _GL_FUNCDECL_SYS (nanosleep, int, | 237 | _GL_FUNCDECL_SYS (nanosleep, int, |
| 219 | (struct timespec const *__rqtp, struct timespec *__rmtp) | 238 | (struct timespec const *__rqtp, struct timespec *__rmtp), |
| 220 | _GL_ARG_NONNULL ((1))); | 239 | _GL_ARG_NONNULL ((1))); |
| 221 | # endif | 240 | # endif |
| 222 | _GL_CXXALIAS_SYS (nanosleep, int, | 241 | _GL_CXXALIAS_SYS (nanosleep, int, |
| @@ -238,7 +257,7 @@ _GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - " | |||
| 238 | # undef tzset | 257 | # undef tzset |
| 239 | # define tzset rpl_tzset | 258 | # define tzset rpl_tzset |
| 240 | # endif | 259 | # endif |
| 241 | _GL_FUNCDECL_RPL (tzset, void, (void)); | 260 | _GL_FUNCDECL_RPL (tzset, void, (void), ); |
| 242 | _GL_CXXALIAS_RPL (tzset, void, (void)); | 261 | _GL_CXXALIAS_RPL (tzset, void, (void)); |
| 243 | # elif defined _WIN32 && !defined __CYGWIN__ | 262 | # elif defined _WIN32 && !defined __CYGWIN__ |
| 244 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 263 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| @@ -278,7 +297,7 @@ _GL_WARN_ON_USE (tzset, "tzset has portability problems - " | |||
| 278 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 297 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 279 | # define mktime rpl_mktime | 298 | # define mktime rpl_mktime |
| 280 | # endif | 299 | # endif |
| 281 | _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); | 300 | _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp), _GL_ARG_NONNULL ((1))); |
| 282 | _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); | 301 | _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); |
| 283 | # else | 302 | # else |
| 284 | _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); | 303 | _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); |
| @@ -304,14 +323,14 @@ _GL_WARN_ON_USE (mktime, "mktime has portability problems - " | |||
| 304 | # define localtime_r rpl_localtime_r | 323 | # define localtime_r rpl_localtime_r |
| 305 | # endif | 324 | # endif |
| 306 | _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, | 325 | _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 307 | struct tm *restrict __result) | 326 | struct tm *restrict __result), |
| 308 | _GL_ARG_NONNULL ((1, 2))); | 327 | _GL_ARG_NONNULL ((1, 2))); |
| 309 | _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, | 328 | _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 310 | struct tm *restrict __result)); | 329 | struct tm *restrict __result)); |
| 311 | # else | 330 | # else |
| 312 | # if ! @HAVE_DECL_LOCALTIME_R@ | 331 | # if ! @HAVE_DECL_LOCALTIME_R@ |
| 313 | _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, | 332 | _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| 314 | struct tm *restrict __result) | 333 | struct tm *restrict __result), |
| 315 | _GL_ARG_NONNULL ((1, 2))); | 334 | _GL_ARG_NONNULL ((1, 2))); |
| 316 | # endif | 335 | # endif |
| 317 | _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, | 336 | _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, |
| @@ -326,14 +345,14 @@ _GL_CXXALIASWARN (localtime_r); | |||
| 326 | # define gmtime_r rpl_gmtime_r | 345 | # define gmtime_r rpl_gmtime_r |
| 327 | # endif | 346 | # endif |
| 328 | _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, | 347 | _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 329 | struct tm *restrict __result) | 348 | struct tm *restrict __result), |
| 330 | _GL_ARG_NONNULL ((1, 2))); | 349 | _GL_ARG_NONNULL ((1, 2))); |
| 331 | _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, | 350 | _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 332 | struct tm *restrict __result)); | 351 | struct tm *restrict __result)); |
| 333 | # else | 352 | # else |
| 334 | # if ! @HAVE_DECL_LOCALTIME_R@ | 353 | # if ! @HAVE_DECL_LOCALTIME_R@ |
| 335 | _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, | 354 | _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| 336 | struct tm *restrict __result) | 355 | struct tm *restrict __result), |
| 337 | _GL_ARG_NONNULL ((1, 2))); | 356 | _GL_ARG_NONNULL ((1, 2))); |
| 338 | # endif | 357 | # endif |
| 339 | _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, | 358 | _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, |
| @@ -364,7 +383,7 @@ _GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - " | |||
| 364 | # undef localtime | 383 | # undef localtime |
| 365 | # define localtime rpl_localtime | 384 | # define localtime rpl_localtime |
| 366 | # endif | 385 | # endif |
| 367 | _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) | 386 | _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer), |
| 368 | _GL_ARG_NONNULL ((1))); | 387 | _GL_ARG_NONNULL ((1))); |
| 369 | _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); | 388 | _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); |
| 370 | # else | 389 | # else |
| @@ -387,7 +406,7 @@ _GL_WARN_ON_USE (localtime, "localtime has portability problems - " | |||
| 387 | # undef gmtime | 406 | # undef gmtime |
| 388 | # define gmtime rpl_gmtime | 407 | # define gmtime rpl_gmtime |
| 389 | # endif | 408 | # endif |
| 390 | _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) | 409 | _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer), |
| 391 | _GL_ARG_NONNULL ((1))); | 410 | _GL_ARG_NONNULL ((1))); |
| 392 | _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); | 411 | _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); |
| 393 | # else | 412 | # else |
| @@ -403,7 +422,7 @@ _GL_CXXALIASWARN (gmtime); | |||
| 403 | # if ! @HAVE_STRPTIME@ | 422 | # if ! @HAVE_STRPTIME@ |
| 404 | _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, | 423 | _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, |
| 405 | char const *restrict __format, | 424 | char const *restrict __format, |
| 406 | struct tm *restrict __tm) | 425 | struct tm *restrict __tm), |
| 407 | _GL_ARG_NONNULL ((1, 2, 3))); | 426 | _GL_ARG_NONNULL ((1, 2, 3))); |
| 408 | # endif | 427 | # endif |
| 409 | _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, | 428 | _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, |
| @@ -428,7 +447,7 @@ _GL_WARN_ON_USE (strptime, "strptime is unportable - " | |||
| 428 | # ifndef __cplusplus | 447 | # ifndef __cplusplus |
| 429 | _GL_ATTRIBUTE_DEPRECATED | 448 | _GL_ATTRIBUTE_DEPRECATED |
| 430 | # endif | 449 | # endif |
| 431 | _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp) | 450 | _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp), |
| 432 | _GL_ARG_NONNULL ((1))); | 451 | _GL_ARG_NONNULL ((1))); |
| 433 | _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); | 452 | _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); |
| 434 | # else | 453 | # else |
| @@ -450,7 +469,7 @@ _GL_CXXALIASWARN (ctime); | |||
| 450 | # endif | 469 | # endif |
| 451 | _GL_FUNCDECL_RPL (strftime, size_t, | 470 | _GL_FUNCDECL_RPL (strftime, size_t, |
| 452 | (char *restrict __buf, size_t __bufsize, | 471 | (char *restrict __buf, size_t __bufsize, |
| 453 | const char *restrict __fmt, const struct tm *restrict __tp) | 472 | const char *restrict __fmt, const struct tm *restrict __tp), |
| 454 | _GL_ARG_NONNULL ((1, 3, 4))); | 473 | _GL_ARG_NONNULL ((1, 3, 4))); |
| 455 | _GL_CXXALIAS_RPL (strftime, size_t, | 474 | _GL_CXXALIAS_RPL (strftime, size_t, |
| 456 | (char *restrict __buf, size_t __bufsize, | 475 | (char *restrict __buf, size_t __bufsize, |
| @@ -471,14 +490,24 @@ _GL_WARN_ON_USE (strftime, "strftime has portability problems - " | |||
| 471 | # endif | 490 | # endif |
| 472 | # endif | 491 | # endif |
| 473 | 492 | ||
| 474 | # if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ | 493 | # if @GNULIB_TIME_RZ@ |
| 475 | /* Functions that use a first-class time zone data type, instead of | 494 | /* Functions that use a first-class time zone data type, instead of |
| 476 | relying on an implicit global time zone. | 495 | relying on an implicit global time zone. |
| 477 | Inspired by NetBSD. */ | 496 | Inspired by NetBSD. */ |
| 478 | 497 | ||
| 479 | /* Represents a time zone. | 498 | /* Represents a time zone. |
| 480 | (timezone_t) NULL stands for UTC. */ | 499 | (timezone_t) NULL stands for UTC. */ |
| 500 | # if !@HAVE_TZALLOC@ | ||
| 501 | # if !GNULIB_defined_timezone_t | ||
| 502 | # if !@HAVE_TIMEZONE_T@ | ||
| 481 | typedef struct tm_zone *timezone_t; | 503 | typedef struct tm_zone *timezone_t; |
| 504 | # else | ||
| 505 | typedef struct tm_zone *rpl_timezone_t; | ||
| 506 | # define timezone_t rpl_timezone_t | ||
| 507 | # endif | ||
| 508 | # define GNULIB_defined_timezone_t 1 | ||
| 509 | # endif | ||
| 510 | # endif | ||
| 482 | 511 | ||
| 483 | /* tzalloc (name) | 512 | /* tzalloc (name) |
| 484 | Returns a time zone object for the given time zone NAME. This object | 513 | Returns a time zone object for the given time zone NAME. This object |
| @@ -488,37 +517,72 @@ typedef struct tm_zone *timezone_t; | |||
| 488 | would use it the TZ environment variable was unset. | 517 | would use it the TZ environment variable was unset. |
| 489 | May return NULL if NAME is invalid (this is platform dependent) or | 518 | May return NULL if NAME is invalid (this is platform dependent) or |
| 490 | upon memory allocation failure. */ | 519 | upon memory allocation failure. */ |
| 491 | _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); | 520 | # if !@HAVE_TZALLOC@ |
| 521 | _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name), ); | ||
| 492 | _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); | 522 | _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); |
| 523 | # endif | ||
| 493 | 524 | ||
| 494 | /* tzfree (tz) | 525 | /* tzfree (tz) |
| 495 | Frees a time zone object. | 526 | Frees a time zone object. |
| 496 | The argument must have been returned by tzalloc(). */ | 527 | The argument must have been returned by tzalloc(). */ |
| 497 | _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); | 528 | # if !@HAVE_TZALLOC@ |
| 529 | _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), ); | ||
| 498 | _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); | 530 | _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); |
| 531 | # endif | ||
| 499 | 532 | ||
| 500 | /* localtime_rz (tz, &t, &result) | 533 | /* localtime_rz (tz, &t, &result) |
| 501 | Converts an absolute time T to a broken-down time RESULT, assuming the | 534 | Converts an absolute time T to a broken-down time RESULT, assuming the |
| 502 | time zone TZ. | 535 | time zone TZ. |
| 503 | This function is like 'localtime_r', but relies on the argument TZ instead | 536 | This function is like 'localtime_r', but relies on the argument TZ instead |
| 504 | of an implicit global time zone. */ | 537 | of an implicit global time zone. */ |
| 538 | # if @REPLACE_LOCALTIME_RZ@ | ||
| 539 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 540 | # undef localtime_rz | ||
| 541 | # define localtime_rz rpl_localtime_rz | ||
| 542 | # endif | ||
| 543 | _GL_FUNCDECL_RPL (localtime_rz, struct tm *, | ||
| 544 | (timezone_t __tz, time_t const *restrict __timer, | ||
| 545 | struct tm *restrict __result), | ||
| 546 | _GL_ARG_NONNULL ((2, 3))); | ||
| 547 | _GL_CXXALIAS_RPL (localtime_rz, struct tm *, | ||
| 548 | (timezone_t __tz, time_t const *restrict __timer, | ||
| 549 | struct tm *restrict __result)); | ||
| 550 | # else | ||
| 551 | # if !@HAVE_TZALLOC@ | ||
| 505 | _GL_FUNCDECL_SYS (localtime_rz, struct tm *, | 552 | _GL_FUNCDECL_SYS (localtime_rz, struct tm *, |
| 506 | (timezone_t __tz, time_t const *restrict __timer, | 553 | (timezone_t __tz, time_t const *restrict __timer, |
| 507 | struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3))); | 554 | struct tm *restrict __result), |
| 555 | _GL_ARG_NONNULL ((2, 3))); | ||
| 556 | # endif | ||
| 508 | _GL_CXXALIAS_SYS (localtime_rz, struct tm *, | 557 | _GL_CXXALIAS_SYS (localtime_rz, struct tm *, |
| 509 | (timezone_t __tz, time_t const *restrict __timer, | 558 | (timezone_t __tz, time_t const *restrict __timer, |
| 510 | struct tm *restrict __result)); | 559 | struct tm *restrict __result)); |
| 560 | # endif | ||
| 511 | 561 | ||
| 512 | /* mktime_z (tz, &tm) | 562 | /* mktime_z (tz, &tm) |
| 513 | Normalizes the broken-down time TM and converts it to an absolute time, | 563 | Normalizes the broken-down time TM and converts it to an absolute time, |
| 514 | assuming the time zone TZ. Returns the absolute time. | 564 | assuming the time zone TZ. Returns the absolute time. |
| 515 | This function is like 'mktime', but relies on the argument TZ instead | 565 | This function is like 'mktime', but relies on the argument TZ instead |
| 516 | of an implicit global time zone. */ | 566 | of an implicit global time zone. */ |
| 567 | # if @REPLACE_MKTIME_Z@ | ||
| 568 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 569 | # undef mktime_z | ||
| 570 | # define mktime_z rpl_mktime_z | ||
| 571 | # endif | ||
| 572 | _GL_FUNCDECL_RPL (mktime_z, time_t, | ||
| 573 | (timezone_t __tz, struct tm *restrict __tm), | ||
| 574 | _GL_ARG_NONNULL ((2))); | ||
| 575 | _GL_CXXALIAS_RPL (mktime_z, time_t, | ||
| 576 | (timezone_t __tz, struct tm *restrict __tm)); | ||
| 577 | # else | ||
| 578 | # if !@HAVE_TZALLOC@ | ||
| 517 | _GL_FUNCDECL_SYS (mktime_z, time_t, | 579 | _GL_FUNCDECL_SYS (mktime_z, time_t, |
| 518 | (timezone_t __tz, struct tm *restrict __tm) | 580 | (timezone_t __tz, struct tm *restrict __tm), |
| 519 | _GL_ARG_NONNULL ((2))); | 581 | _GL_ARG_NONNULL ((2))); |
| 582 | # endif | ||
| 520 | _GL_CXXALIAS_SYS (mktime_z, time_t, | 583 | _GL_CXXALIAS_SYS (mktime_z, time_t, |
| 521 | (timezone_t __tz, struct tm *restrict __tm)); | 584 | (timezone_t __tz, struct tm *restrict __tm)); |
| 585 | # endif | ||
| 522 | 586 | ||
| 523 | /* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z' | 587 | /* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z' |
| 524 | in the 'tm_zone' member of 'struct tm') are valid as long as | 588 | in the 'tm_zone' member of 'struct tm') are valid as long as |
| @@ -535,11 +599,11 @@ _GL_CXXALIAS_SYS (mktime_z, time_t, | |||
| 535 | # undef timegm | 599 | # undef timegm |
| 536 | # define timegm rpl_timegm | 600 | # define timegm rpl_timegm |
| 537 | # endif | 601 | # endif |
| 538 | _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); | 602 | _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1))); |
| 539 | _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); | 603 | _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); |
| 540 | # else | 604 | # else |
| 541 | # if ! @HAVE_TIMEGM@ | 605 | # if ! @HAVE_TIMEGM@ |
| 542 | _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); | 606 | _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm), _GL_ARG_NONNULL ((1))); |
| 543 | # endif | 607 | # endif |
| 544 | _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); | 608 | _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); |
| 545 | # endif | 609 | # endif |
