GDBserver
time.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A more-standard <time.h>.
3 
4  Copyright (C) 2007-2016 Free Software Foundation, Inc.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, see <http://www.gnu.org/licenses/>. */
18 
19 #if __GNUC__ >= 3
20 #pragma GCC system_header
21 #endif
22 
23 
24 /* Don't get in the way of glibc when it includes time.h merely to
25  declare a few standard symbols, rather than to declare all the
26  symbols. (However, skip this for MinGW as it treats __need_time_t
27  incompatibly.) Also, Solaris 8 <time.h> eventually includes itself
28  recursively; if that is happening, just include the system <time.h>
29  without adding our own declarations. */
30 #if (((defined __need_time_t || defined __need_clock_t \
31  || defined __need_timespec) \
32  && !defined __MINGW32__) \
33  || defined _GL_TIME_H)
34 
35 # include_next <time.h>
36 
37 #else
38 
39 # define _GL_TIME_H
40 
41 # include_next <time.h>
42 
43 /* NetBSD 5.0 mis-defines NULL. */
44 # include <stddef.h>
45 
46 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
47 #ifndef _GL_CXXDEFS_H
48 #define _GL_CXXDEFS_H
49 
50 /* Begin/end the GNULIB_NAMESPACE namespace. */
51 #if defined __cplusplus && defined GNULIB_NAMESPACE
52 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
53 # define _GL_END_NAMESPACE }
54 #else
55 # define _GL_BEGIN_NAMESPACE
56 # define _GL_END_NAMESPACE
57 #endif
58 
59 /* The three most frequent use cases of these macros are:
60 
61  * For providing a substitute for a function that is missing on some
62  platforms, but is declared and works fine on the platforms on which
63  it exists:
64 
65  #if @GNULIB_FOO@
66  # if !@HAVE_FOO@
67  _GL_FUNCDECL_SYS (foo, ...);
68  # endif
69  _GL_CXXALIAS_SYS (foo, ...);
70  _GL_CXXALIASWARN (foo);
71  #elif defined GNULIB_POSIXCHECK
72  ...
73  #endif
74 
75  * For providing a replacement for a function that exists on all platforms,
76  but is broken/insufficient and needs to be replaced on some platforms:
77 
78  #if @GNULIB_FOO@
79  # if @REPLACE_FOO@
80  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
81  # undef foo
82  # define foo rpl_foo
83  # endif
84  _GL_FUNCDECL_RPL (foo, ...);
85  _GL_CXXALIAS_RPL (foo, ...);
86  # else
87  _GL_CXXALIAS_SYS (foo, ...);
88  # endif
89  _GL_CXXALIASWARN (foo);
90  #elif defined GNULIB_POSIXCHECK
91  ...
92  #endif
93 
94  * For providing a replacement for a function that exists on some platforms
95  but is broken/insufficient and needs to be replaced on some of them and
96  is additionally either missing or undeclared on some other platforms:
97 
98  #if @GNULIB_FOO@
99  # if @REPLACE_FOO@
100  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
101  # undef foo
102  # define foo rpl_foo
103  # endif
104  _GL_FUNCDECL_RPL (foo, ...);
105  _GL_CXXALIAS_RPL (foo, ...);
106  # else
107  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
108  _GL_FUNCDECL_SYS (foo, ...);
109  # endif
110  _GL_CXXALIAS_SYS (foo, ...);
111  # endif
112  _GL_CXXALIASWARN (foo);
113  #elif defined GNULIB_POSIXCHECK
114  ...
115  #endif
116 */
117 
118 /* _GL_EXTERN_C declaration;
119  performs the declaration with C linkage. */
120 #if defined __cplusplus
121 # define _GL_EXTERN_C extern "C"
122 #else
123 # define _GL_EXTERN_C extern
124 #endif
125 
126 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
127  declares a replacement function, named rpl_func, with the given prototype,
128  consisting of return type, parameters, and attributes.
129  Example:
130  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
131  _GL_ARG_NONNULL ((1)));
132  */
133 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
134  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
135 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
136  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
137 
138 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
139  declares the system function, named func, with the given prototype,
140  consisting of return type, parameters, and attributes.
141  Example:
142  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
143  _GL_ARG_NONNULL ((1)));
144  */
145 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
146  _GL_EXTERN_C rettype func parameters_and_attributes
147 
148 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
149  declares a C++ alias called GNULIB_NAMESPACE::func
150  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
151  Example:
152  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
153 
154  Wrapping rpl_func in an object with an inline conversion operator
155  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
156  actually used in the program. */
157 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
158  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
159 #if defined __cplusplus && defined GNULIB_NAMESPACE
160 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
161  namespace GNULIB_NAMESPACE \
162  { \
163  static const struct _gl_ ## func ## _wrapper \
164  { \
165  typedef rettype (*type) parameters; \
166  inline type rpl () const { return ::rpl_func; } \
167  inline operator type () const { return rpl (); } \
168  } func = {}; \
169  } \
170  _GL_EXTERN_C int _gl_cxxalias_dummy
171 #else
172 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
173  _GL_EXTERN_C int _gl_cxxalias_dummy
174 #endif
175 
176 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
177  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
178  except that the C function rpl_func may have a slightly different
179  declaration. A cast is used to silence the "invalid conversion" error
180  that would otherwise occur. */
181 #if defined __cplusplus && defined GNULIB_NAMESPACE
182 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
183  namespace GNULIB_NAMESPACE \
184  { \
185  static const struct _gl_ ## func ## _wrapper \
186  { \
187  typedef rettype (*type) parameters; \
188  inline type rpl () const \
189  { return reinterpret_cast<type>(::rpl_func); } \
190  inline operator type () const { return rpl (); } \
191  } func = {}; \
192  } \
193  _GL_EXTERN_C int _gl_cxxalias_dummy
194 #else
195 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
196  _GL_EXTERN_C int _gl_cxxalias_dummy
197 #endif
198 
199 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
200  declares a C++ alias called GNULIB_NAMESPACE::func
201  that redirects to the system provided function func, if GNULIB_NAMESPACE
202  is defined.
203  Example:
204  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
205 
206  Wrapping func in an object with an inline conversion operator
207  avoids a reference to func unless GNULIB_NAMESPACE::func is
208  actually used in the program. */
209 #if defined __cplusplus && defined GNULIB_NAMESPACE
210 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
211  namespace GNULIB_NAMESPACE \
212  { \
213  static const struct _gl_ ## func ## _wrapper \
214  { \
215  typedef rettype (*type) parameters; \
216  inline type rpl () const { return ::func; } \
217  inline operator type () const { return rpl (); } \
218  } func = {}; \
219  } \
220  _GL_EXTERN_C int _gl_cxxalias_dummy
221 #else
222 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
223  _GL_EXTERN_C int _gl_cxxalias_dummy
224 #endif
225 
226 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
227  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
228  except that the C function func may have a slightly different declaration.
229  A cast is used to silence the "invalid conversion" error that would
230  otherwise occur. */
231 #if defined __cplusplus && defined GNULIB_NAMESPACE
232 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
233  namespace GNULIB_NAMESPACE \
234  { \
235  static const struct _gl_ ## func ## _wrapper \
236  { \
237  typedef rettype (*type) parameters; \
238  inline type rpl () const \
239  { return reinterpret_cast<type>(::func); } \
240  inline operator type () const { return rpl (); }\
241  } func = {}; \
242  } \
243  _GL_EXTERN_C int _gl_cxxalias_dummy
244 #else
245 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
246  _GL_EXTERN_C int _gl_cxxalias_dummy
247 #endif
248 
249 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
250  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
251  except that the C function is picked among a set of overloaded functions,
252  namely the one with rettype2 and parameters2. Two consecutive casts
253  are used to silence the "cannot find a match" and "invalid conversion"
254  errors that would otherwise occur. */
255 #if defined __cplusplus && defined GNULIB_NAMESPACE
256  /* The outer cast must be a reinterpret_cast.
257  The inner cast: When the function is defined as a set of overloaded
258  functions, it works as a static_cast<>, choosing the designated variant.
259  When the function is defined as a single variant, it works as a
260  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
261 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
262  namespace GNULIB_NAMESPACE \
263  { \
264  static const struct _gl_ ## func ## _wrapper \
265  { \
266  typedef rettype (*type) parameters; \
267  \
268  inline type rpl () const \
269  { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
270  \
271  inline operator type () const { return rpl (); } \
272  } func = {}; \
273  } \
274  _GL_EXTERN_C int _gl_cxxalias_dummy
275 #else
276 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
277  _GL_EXTERN_C int _gl_cxxalias_dummy
278 #endif
279 
280 /* _GL_CXXALIASWARN (func);
281  causes a warning to be emitted when ::func is used but not when
282  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
283  variants. */
284 #if defined __cplusplus && defined GNULIB_NAMESPACE
285 # define _GL_CXXALIASWARN(func) \
286  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
287 # define _GL_CXXALIASWARN_1(func,namespace) \
288  _GL_CXXALIASWARN_2 (func, namespace)
289 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
290  we enable the warning only when not optimizing. */
291 # if !__OPTIMIZE__
292 # define _GL_CXXALIASWARN_2(func,namespace) \
293  _GL_WARN_ON_USE (func, \
294  "The symbol ::" #func " refers to the system function. " \
295  "Use " #namespace "::" #func " instead.")
296 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
297 # define _GL_CXXALIASWARN_2(func,namespace) \
298  extern __typeof__ (func) func
299 # else
300 # define _GL_CXXALIASWARN_2(func,namespace) \
301  _GL_EXTERN_C int _gl_cxxalias_dummy
302 # endif
303 #else
304 # define _GL_CXXALIASWARN(func) \
305  _GL_EXTERN_C int _gl_cxxalias_dummy
306 #endif
307 
308 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
309  causes a warning to be emitted when the given overloaded variant of ::func
310  is used but not when GNULIB_NAMESPACE::func is used. */
311 #if defined __cplusplus && defined GNULIB_NAMESPACE
312 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
313  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
314  GNULIB_NAMESPACE)
315 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
316  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
317 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
318  we enable the warning only when not optimizing. */
319 # if !__OPTIMIZE__
320 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
321  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
322  "The symbol ::" #func " refers to the system function. " \
323  "Use " #namespace "::" #func " instead.")
324 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
325 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
326  extern __typeof__ (func) func
327 # else
328 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
329  _GL_EXTERN_C int _gl_cxxalias_dummy
330 # endif
331 #else
332 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
333  _GL_EXTERN_C int _gl_cxxalias_dummy
334 #endif
335 
336 #endif /* _GL_CXXDEFS_H */
337 
338 /* The definition of _GL_ARG_NONNULL is copied here. */
339 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
340  that the values passed as arguments n, ..., m must be non-NULL pointers.
341  n = 1 stands for the first argument, n = 2 for the second argument etc. */
342 #ifndef _GL_ARG_NONNULL
343 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
344 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
345 # else
346 # define _GL_ARG_NONNULL(params)
347 # endif
348 #endif
349 
350 /* The definition of _GL_WARN_ON_USE is copied here. */
351 #ifndef _GL_WARN_ON_USE
352 
353 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
354 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
355 # define _GL_WARN_ON_USE(function, message) \
356 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
357 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
358 /* Verify the existence of the function. */
359 # define _GL_WARN_ON_USE(function, message) \
360 extern __typeof__ (function) function
361 # else /* Unsupported. */
362 # define _GL_WARN_ON_USE(function, message) \
363 _GL_WARN_EXTERN_C int _gl_warn_on_use
364 # endif
365 #endif
366 
367 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
368  is like _GL_WARN_ON_USE (function, "string"), except that the function is
369  declared with the given prototype, consisting of return type, parameters,
370  and attributes.
371  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
372  not work in this case. */
373 #ifndef _GL_WARN_ON_USE_CXX
374 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
375 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
376 extern rettype function parameters_and_attributes \
377  __attribute__ ((__warning__ (msg)))
378 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
379 /* Verify the existence of the function. */
380 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
381 extern rettype function parameters_and_attributes
382 # else /* Unsupported. */
383 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
384 _GL_WARN_EXTERN_C int _gl_warn_on_use
385 # endif
386 #endif
387 
388 /* _GL_WARN_EXTERN_C declaration;
389  performs the declaration with C linkage. */
390 #ifndef _GL_WARN_EXTERN_C
391 # if defined __cplusplus
392 # define _GL_WARN_EXTERN_C extern "C"
393 # else
394 # define _GL_WARN_EXTERN_C extern
395 # endif
396 #endif
397 
398 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
399  Or they define it with the wrong member names or define it in <sys/time.h>
400  (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it,
401  but the pthreads-win32 library defines it in <pthread.h>. */
402 # if ! 1
403 # if 0
404 # include <sys/time.h>
405 # elif 0
406 # include <pthread.h>
407 # elif 0
408 # include <unistd.h>
409 # else
410 
411 # ifdef __cplusplus
412 extern "C" {
413 # endif
414 
415 # if !GNULIB_defined_struct_timespec
416 # undef timespec
417 # define timespec rpl_timespec
418 struct timespec
419 {
420  time_t tv_sec;
421  long int tv_nsec;
422 };
423 # define GNULIB_defined_struct_timespec 1
424 # endif
425 
426 # ifdef __cplusplus
427 }
428 # endif
429 
430 # endif
431 # endif
432 
433 # if !GNULIB_defined_struct_time_t_must_be_integral
434 /* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
435  time_t to be an integer type, even though C99 permits floating
436  point. We don't know of any implementation that uses floating
437  point, and it is much easier to write code that doesn't have to
438  worry about that corner case, so we force the issue. */
440  unsigned int __floating_time_t_unsupported : (time_t) 1;
441 };
442 # define GNULIB_defined_struct_time_t_must_be_integral 1
443 # endif
444 
445 /* Sleep for at least RQTP seconds unless interrupted, If interrupted,
446  return -1 and store the remaining time into RMTP. See
447  <http://www.opengroup.org/susv3xsh/nanosleep.html>. */
448 # if 0
449 # if GNULIB_PORTCHECK
450 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
451 # define nanosleep rpl_nanosleep
452 # endif
453 _GL_FUNCDECL_RPL (nanosleep, int,
454  (struct timespec const *__rqtp, struct timespec *__rmtp)
455  _GL_ARG_NONNULL ((1)));
456 _GL_CXXALIAS_RPL (nanosleep, int,
457  (struct timespec const *__rqtp, struct timespec *__rmtp));
458 # else
459 # if ! 1
460 _GL_FUNCDECL_SYS (nanosleep, int,
461  (struct timespec const *__rqtp, struct timespec *__rmtp)
462  _GL_ARG_NONNULL ((1)));
463 # endif
464 _GL_CXXALIAS_SYS (nanosleep, int,
465  (struct timespec const *__rqtp, struct timespec *__rmtp));
466 # endif
467 _GL_CXXALIASWARN (nanosleep);
468 # endif
469 
470 /* Return the 'time_t' representation of TP and normalize TP. */
471 # if 0
472 # if GNULIB_PORTCHECK
473 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
474 # define mktime rpl_mktime
475 # endif
476 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
477 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
478 # else
479 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
480 # endif
481 _GL_CXXALIASWARN (mktime);
482 # endif
483 
484 /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
485  <http://www.opengroup.org/susv3xsh/localtime_r.html> and
486  <http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
487 # if 0
488 # if GNULIB_PORTCHECK
489 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
490 # undef localtime_r
491 # define localtime_r rpl_localtime_r
492 # endif
493 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
494  struct tm *restrict __result)
495  _GL_ARG_NONNULL ((1, 2)));
496 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
497  struct tm *restrict __result));
498 # else
499 # if ! 1
500 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
501  struct tm *restrict __result)
502  _GL_ARG_NONNULL ((1, 2)));
503 # endif
504 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
505  struct tm *restrict __result));
506 # endif
507 # if 1
508 _GL_CXXALIASWARN (localtime_r);
509 # endif
510 # if GNULIB_PORTCHECK
511 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
512 # undef gmtime_r
513 # define gmtime_r rpl_gmtime_r
514 # endif
515 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
516  struct tm *restrict __result)
517  _GL_ARG_NONNULL ((1, 2)));
518 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
519  struct tm *restrict __result));
520 # else
521 # if ! 1
522 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
523  struct tm *restrict __result)
524  _GL_ARG_NONNULL ((1, 2)));
525 # endif
526 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
527  struct tm *restrict __result));
528 # endif
529 # if 1
530 _GL_CXXALIASWARN (gmtime_r);
531 # endif
532 # endif
533 
534 /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
535  <http://www.opengroup.org/susv3xsh/localtime.html> and
536  <http://www.opengroup.org/susv3xsh/gmtime.html>. */
537 # if 1
538 # if 0
539 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
540 # undef localtime
541 # define localtime rpl_localtime
542 # endif
543 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
544  _GL_ARG_NONNULL ((1)));
545 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
546 # else
547 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
548 # endif
549 _GL_CXXALIASWARN (localtime);
550 # endif
551 
552 # if 1
553 # if 0
554 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
555 # undef gmtime
556 # define gmtime rpl_gmtime
557 # endif
558 _GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
559  _GL_ARG_NONNULL ((1)));
560 _GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
561 # else
562 _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
563 # endif
564 _GL_CXXALIASWARN (gmtime);
565 # endif
566 
567 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
568  the resulting broken-down time into TM. See
569  <http://www.opengroup.org/susv3xsh/strptime.html>. */
570 # if 0
571 # if ! 1
572 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
573  char const *restrict __format,
574  struct tm *restrict __tm)
575  _GL_ARG_NONNULL ((1, 2, 3)));
576 # endif
577 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
578  char const *restrict __format,
579  struct tm *restrict __tm));
580 _GL_CXXALIASWARN (strptime);
581 # endif
582 
583 # if defined _GNU_SOURCE && 0 && ! 0
584 typedef struct tm_zone *timezone_t;
585 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
586 _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
587 _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
588 _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
589 _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
590  (timezone_t __tz, time_t const *restrict __timer,
591  struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
592 _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
593  (timezone_t __tz, time_t const *restrict __timer,
594  struct tm *restrict __result));
595 _GL_FUNCDECL_SYS (mktime_z, time_t,
596  (timezone_t __tz, struct tm *restrict __result)
597  _GL_ARG_NONNULL ((2)));
598 _GL_CXXALIAS_SYS (mktime_z, time_t,
599  (timezone_t __tz, struct tm *restrict __result));
600 # endif
601 
602 /* Convert TM to a time_t value, assuming UTC. */
603 # if 0
604 # if GNULIB_PORTCHECK
605 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
606 # undef timegm
607 # define timegm rpl_timegm
608 # endif
609 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
610 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
611 # else
612 # if ! 1
613 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
614 # endif
615 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
616 # endif
617 _GL_CXXALIASWARN (timegm);
618 # endif
619 
620 /* Encourage applications to avoid unsafe functions that can overrun
621  buffers when given outlandish struct tm values. Portable
622  applications should use strftime (or even sprintf) instead. */
623 # if defined GNULIB_POSIXCHECK
624 # undef asctime
625 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
626  "better use strftime (or even sprintf) instead");
627 # endif
628 # if defined GNULIB_POSIXCHECK
629 # undef asctime_r
630 _GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
631  "better use strftime (or even sprintf) instead");
632 # endif
633 # if defined GNULIB_POSIXCHECK
634 # undef ctime
635 _GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
636  "better use strftime (or even sprintf) instead");
637 # endif
638 # if defined GNULIB_POSIXCHECK
639 # undef ctime_r
640 _GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
641  "better use strftime (or even sprintf) instead");
642 # endif
643 
644 #endif
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: time.h:157
#define _GL_ARG_NONNULL(params)
Definition: time.h:346
#define _GL_WARN_ON_USE(function, message)
Definition: time.h:362
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: time.h:145
#define _GL_CXXALIASWARN(func)
Definition: time.h:304
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: time.h:133
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: time.h:222
unsigned int __floating_time_t_unsupported
Definition: time.h:440
#define restrict
Definition: config.h:1902