20 #pragma GCC system_header 30 #if (((defined __need_time_t || defined __need_clock_t \ 31 || defined __need_timespec) \ 32 && !defined __MINGW32__) \ 33 || defined _GL_TIME_H) 35 # include_next <time.h> 41 # include_next <time.h> 67 #if defined __cplusplus && defined GNULIB_NAMESPACE 68 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 69 # define _GL_END_NAMESPACE } 71 # define _GL_BEGIN_NAMESPACE 72 # define _GL_END_NAMESPACE 136 #if defined __cplusplus 137 # define _GL_EXTERN_C extern "C" 139 # define _GL_EXTERN_C extern 149 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 150 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 151 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 152 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 161 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 162 _GL_EXTERN_C rettype func parameters_and_attributes 173 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 174 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 175 #if defined __cplusplus && defined GNULIB_NAMESPACE 176 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 177 namespace GNULIB_NAMESPACE \ 179 static const struct _gl_ ## func ## _wrapper \ 181 typedef rettype (*type) parameters; \ 183 inline operator type () const \ 189 _GL_EXTERN_C int _gl_cxxalias_dummy 191 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 192 _GL_EXTERN_C int _gl_cxxalias_dummy 200 #if defined __cplusplus && defined GNULIB_NAMESPACE 201 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 202 namespace GNULIB_NAMESPACE \ 204 static const struct _gl_ ## func ## _wrapper \ 206 typedef rettype (*type) parameters; \ 208 inline operator type () const \ 210 return reinterpret_cast<type>(::rpl_func); \ 214 _GL_EXTERN_C int _gl_cxxalias_dummy 216 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 217 _GL_EXTERN_C int _gl_cxxalias_dummy 230 #if defined __cplusplus && defined GNULIB_NAMESPACE 231 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 232 namespace GNULIB_NAMESPACE \ 234 static const struct _gl_ ## func ## _wrapper \ 236 typedef rettype (*type) parameters; \ 238 inline operator type () const \ 244 _GL_EXTERN_C int _gl_cxxalias_dummy 246 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 247 _GL_EXTERN_C int _gl_cxxalias_dummy 255 #if defined __cplusplus && defined GNULIB_NAMESPACE 256 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 257 namespace GNULIB_NAMESPACE \ 259 static const struct _gl_ ## func ## _wrapper \ 261 typedef rettype (*type) parameters; \ 263 inline operator type () const \ 265 return reinterpret_cast<type>(::func); \ 269 _GL_EXTERN_C int _gl_cxxalias_dummy 271 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 272 _GL_EXTERN_C int _gl_cxxalias_dummy 281 #if defined __cplusplus && defined GNULIB_NAMESPACE 287 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 288 namespace GNULIB_NAMESPACE \ 290 static const struct _gl_ ## func ## _wrapper \ 292 typedef rettype (*type) parameters; \ 294 inline operator type () const \ 296 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 300 _GL_EXTERN_C int _gl_cxxalias_dummy 302 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 303 _GL_EXTERN_C int _gl_cxxalias_dummy 310 #if defined __cplusplus && defined GNULIB_NAMESPACE 311 # define _GL_CXXALIASWARN(func) \ 312 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 313 # define _GL_CXXALIASWARN_1(func,namespace) \ 314 _GL_CXXALIASWARN_2 (func, namespace) 318 # define _GL_CXXALIASWARN_2(func,namespace) \ 319 _GL_WARN_ON_USE (func, \ 320 "The symbol ::" #func " refers to the system function. " \ 321 "Use " #namespace "::" #func " instead.") 322 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 323 # define _GL_CXXALIASWARN_2(func,namespace) \ 324 extern __typeof__ (func) func 326 # define _GL_CXXALIASWARN_2(func,namespace) \ 327 _GL_EXTERN_C int _gl_cxxalias_dummy 330 # define _GL_CXXALIASWARN(func) \ 331 _GL_EXTERN_C int _gl_cxxalias_dummy 337 #if defined __cplusplus && defined GNULIB_NAMESPACE 338 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 339 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 341 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 342 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 346 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 347 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 348 "The symbol ::" #func " refers to the system function. " \ 349 "Use " #namespace "::" #func " instead.") 350 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 351 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 352 extern __typeof__ (func) func 354 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 355 _GL_EXTERN_C int _gl_cxxalias_dummy 358 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 359 _GL_EXTERN_C int _gl_cxxalias_dummy 384 #ifndef _GL_ARG_NONNULL 385 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 386 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 388 # define _GL_ARG_NONNULL(params) 456 #ifndef _GL_WARN_ON_USE 458 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 460 # define _GL_WARN_ON_USE(function, message) \ 461 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 462 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 464 # define _GL_WARN_ON_USE(function, message) \ 465 extern __typeof__ (function) function 467 # define _GL_WARN_ON_USE(function, message) \ 468 _GL_WARN_EXTERN_C int _gl_warn_on_use 478 #ifndef _GL_WARN_ON_USE_CXX 479 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 480 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 481 extern rettype function parameters_and_attributes \ 482 __attribute__ ((__warning__ (msg))) 483 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 485 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 486 extern rettype function parameters_and_attributes 488 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 489 _GL_WARN_EXTERN_C int _gl_warn_on_use 495 #ifndef _GL_WARN_EXTERN_C 496 # if defined __cplusplus 497 # define _GL_WARN_EXTERN_C extern "C" 499 # define _GL_WARN_EXTERN_C extern 509 # include <sys/time.h> 511 # include <pthread.h> 520 # if !GNULIB_defined_struct_timespec 522 # define timespec rpl_timespec 528 # define GNULIB_defined_struct_timespec 1 538 # if !GNULIB_defined_struct_time_t_must_be_integral 547 # define GNULIB_defined_struct_time_t_must_be_integral 1 554 # if GNULIB_PORTCHECK 555 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 556 # define nanosleep rpl_nanosleep 578 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 580 # define tzset rpl_tzset 596 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 597 # define mktime rpl_mktime 612 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 614 # define localtime_r rpl_localtime_r 634 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 636 # define gmtime_r rpl_gmtime_r 662 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 664 # define localtime rpl_localtime 677 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 679 # define gmtime rpl_gmtime 709 # if GNULIB_PORTCHECK 710 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 711 # define ctime rpl_ctime 725 # if GNULIB_PORTCHECK 726 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 727 # define strftime rpl_strftime 730 const char *__fmt,
const struct tm *__tp)
733 const char *__fmt,
const struct tm *__tp));
736 const char *__fmt,
const struct tm *__tp));
741 # if defined _GNU_SOURCE && 1 && ! 0 742 typedef struct tm_zone *timezone_t;
748 (timezone_t __tz, time_t
const *
restrict __timer,
751 (timezone_t __tz, time_t
const *
restrict __timer,
754 (timezone_t __tz,
struct tm *
restrict __result)
757 (timezone_t __tz,
struct tm *
restrict __result));
763 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 765 # define timegm rpl_timegm 781 # if defined GNULIB_POSIXCHECK 783 _GL_WARN_ON_USE (asctime,
"asctime can overrun buffers in some cases - " 784 "better use strftime (or even sprintf) instead");
786 # if defined GNULIB_POSIXCHECK 788 _GL_WARN_ON_USE (asctime,
"asctime_r can overrun buffers in some cases - " 789 "better use strftime (or even sprintf) instead");
791 # if defined GNULIB_POSIXCHECK 794 "better use strftime (or even sprintf) instead");
796 # if defined GNULIB_POSIXCHECK 798 _GL_WARN_ON_USE (asctime,
"ctime_r can overrun buffers in some cases - " 799 "better use strftime (or even sprintf) instead");
Definition: time-internal.h:21
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: time.h:173
unsigned int __floating_time_t_unsupported
Definition: time.h:545
time_t mktime_z(timezone_t tz, struct tm *tm)
Definition: time_rz.c:306
#define _GL_ARG_NONNULL(params)
Definition: time.h:388
timezone_t tzalloc(char const *name)
Definition: time_rz.c:95
#define _GL_WARN_ON_USE(function, message)
Definition: time.h:467
struct tm * localtime_r(time_t const *restrict t, struct tm *restrict tp)
Definition: time_r.c:41
void tzfree(timezone_t tz)
Definition: time_rz.c:196
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: time.h:161
#define _GL_CXXALIASWARN(func)
Definition: time.h:330
time_t tv_sec
Definition: time.in.h:73
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: time.h:149
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: time.h:246
time_t timegm(struct tm *tmp)
Definition: timegm.c:35
struct tm * gmtime_r(time_t const *restrict t, struct tm *restrict tp)
Definition: time_r.c:35
void tzset(void)
Definition: tzset.c:34
struct tm * localtime_rz(timezone_t tz, time_t const *t, struct tm *tm)
Definition: time_rz.c:287
long int tv_nsec
Definition: time.in.h:74
#define restrict
Definition: config.h:1858