20 #pragma GCC system_header
29 #if (defined __need_time_t || defined __need_clock_t \
30 || defined __need_timespec \
31 || defined _GL_TIME_H)
33 # include_next <time.h>
39 # include_next <time.h>
109 #if defined __cplusplus
110 # define _GL_EXTERN_C extern "C"
112 # define _GL_EXTERN_C extern
122 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
123 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
124 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
125 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
134 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
135 _GL_EXTERN_C rettype func parameters_and_attributes
143 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
144 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
145 #if defined __cplusplus && defined GNULIB_NAMESPACE
146 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
147 namespace GNULIB_NAMESPACE \
149 rettype (*const func) parameters = ::rpl_func; \
151 _GL_EXTERN_C int _gl_cxxalias_dummy
153 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
154 _GL_EXTERN_C int _gl_cxxalias_dummy
162 #if defined __cplusplus && defined GNULIB_NAMESPACE
163 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
164 namespace GNULIB_NAMESPACE \
166 rettype (*const func) parameters = \
167 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
169 _GL_EXTERN_C int _gl_cxxalias_dummy
171 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
172 _GL_EXTERN_C int _gl_cxxalias_dummy
182 #if defined __cplusplus && defined GNULIB_NAMESPACE
189 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
190 namespace GNULIB_NAMESPACE \
192 static rettype (*func) parameters = ::func; \
194 _GL_EXTERN_C int _gl_cxxalias_dummy
196 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
197 _GL_EXTERN_C int _gl_cxxalias_dummy
205 #if defined __cplusplus && defined GNULIB_NAMESPACE
206 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
207 namespace GNULIB_NAMESPACE \
209 static rettype (*func) parameters = \
210 reinterpret_cast<rettype(*)parameters>(::func); \
212 _GL_EXTERN_C int _gl_cxxalias_dummy
214 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
215 _GL_EXTERN_C int _gl_cxxalias_dummy
224 #if defined __cplusplus && defined GNULIB_NAMESPACE
230 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
231 namespace GNULIB_NAMESPACE \
233 static rettype (*func) parameters = \
234 reinterpret_cast<rettype(*)parameters>( \
235 (rettype2(*)parameters2)(::func)); \
237 _GL_EXTERN_C int _gl_cxxalias_dummy
239 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
240 _GL_EXTERN_C int _gl_cxxalias_dummy
247 #if defined __cplusplus && defined GNULIB_NAMESPACE
248 # define _GL_CXXALIASWARN(func) \
249 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
250 # define _GL_CXXALIASWARN_1(func,namespace) \
251 _GL_CXXALIASWARN_2 (func, namespace)
255 # define _GL_CXXALIASWARN_2(func,namespace) \
256 _GL_WARN_ON_USE (func, \
257 "The symbol ::" #func " refers to the system function. " \
258 "Use " #namespace "::" #func " instead.")
259 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
260 # define _GL_CXXALIASWARN_2(func,namespace) \
261 extern __typeof__ (func) func
263 # define _GL_CXXALIASWARN_2(func,namespace) \
264 _GL_EXTERN_C int _gl_cxxalias_dummy
267 # define _GL_CXXALIASWARN(func) \
268 _GL_EXTERN_C int _gl_cxxalias_dummy
274 #if defined __cplusplus && defined GNULIB_NAMESPACE
275 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
276 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
278 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
279 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
283 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
284 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
285 "The symbol ::" #func " refers to the system function. " \
286 "Use " #namespace "::" #func " instead.")
287 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
288 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
289 extern __typeof__ (func) func
291 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
292 _GL_EXTERN_C int _gl_cxxalias_dummy
295 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
296 _GL_EXTERN_C int _gl_cxxalias_dummy
305 #ifndef _GL_ARG_NONNULL
306 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
307 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
309 # define _GL_ARG_NONNULL(params)
314 #ifndef _GL_WARN_ON_USE
316 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
318 # define _GL_WARN_ON_USE(function, message) \
319 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
320 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
322 # define _GL_WARN_ON_USE(function, message) \
323 extern __typeof__ (function) function
325 # define _GL_WARN_ON_USE(function, message) \
326 _GL_WARN_EXTERN_C int _gl_warn_on_use
336 #ifndef _GL_WARN_ON_USE_CXX
337 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
338 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
339 extern rettype function parameters_and_attributes \
340 __attribute__ ((__warning__ (msg)))
341 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
343 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
344 extern rettype function parameters_and_attributes
346 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
347 _GL_WARN_EXTERN_C int _gl_warn_on_use
353 #ifndef _GL_WARN_EXTERN_C
354 # if defined __cplusplus
355 # define _GL_WARN_EXTERN_C extern "C"
357 # define _GL_WARN_EXTERN_C extern
367 # include <sys/time.h>
369 # include <pthread.h>
383 # if !GNULIB_defined_struct_timespec
385 # define timespec rpl_timespec
391 # define GNULIB_defined_struct_timespec 1
401 # if !GNULIB_defined_struct_time_t_must_be_integral
410 # define GNULIB_defined_struct_time_t_must_be_integral 1
417 # if GNULIB_PORTCHECK
418 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
419 # define nanosleep rpl_nanosleep
422 (
struct timespec
const *__rqtp,
struct timespec *__rmtp)
425 (
struct timespec
const *__rqtp,
struct timespec *__rmtp));
429 (
struct timespec
const *__rqtp,
struct timespec *__rmtp)
433 (
struct timespec
const *__rqtp,
struct timespec *__rmtp));
440 # if GNULIB_PORTCHECK
441 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
442 # define mktime rpl_mktime
456 # if GNULIB_PORTCHECK
457 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
459 # define localtime_r rpl_localtime_r
478 # if GNULIB_PORTCHECK
479 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
481 # define gmtime_r rpl_gmtime_r
520 # if GNULIB_PORTCHECK
521 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
523 # define timegm rpl_timegm
539 # if defined GNULIB_POSIXCHECK
541 _GL_WARN_ON_USE (asctime,
"asctime can overrun buffers in some cases - "
542 "better use strftime (or even sprintf) instead");
544 # if defined GNULIB_POSIXCHECK
546 _GL_WARN_ON_USE (asctime,
"asctime_r can overrun buffers in some cases - "
547 "better use strftime (or even sprintf) instead");
549 # if defined GNULIB_POSIXCHECK
552 "better use strftime (or even sprintf) instead");
554 # if defined GNULIB_POSIXCHECK
556 _GL_WARN_ON_USE (asctime,
"ctime_r can overrun buffers in some cases - "
557 "better use strftime (or even sprintf) instead");
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
#define _GL_ARG_NONNULL(params)
#define _GL_WARN_ON_USE(function, message)
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
#define _GL_CXXALIASWARN(func)
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
unsigned int __floating_time_t_unsupported