mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Declare timegm for ISO C2X
The next revision of the ISO C standard has added the timegm function (that was already supported in glibc). Update the feature test conditionals on its declaration in <time.h> accordingly. Tested for x86_64.
This commit is contained in:
19
time/time.h
19
time/time.h
@@ -240,21 +240,30 @@ extern long int timezone;
|
|||||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||||
|
|
||||||
|
|
||||||
|
#if defined __USE_MISC || __GLIBC_USE (ISOC2X)
|
||||||
|
# ifndef __USE_TIME_BITS64
|
||||||
|
/* Like `mktime', but for TP represents Universal Time, not local time. */
|
||||||
|
extern time_t timegm (struct tm *__tp) __THROW;
|
||||||
|
# else
|
||||||
|
# ifdef __REDIRECT_NTH
|
||||||
|
extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
|
||||||
|
# else
|
||||||
|
# define timegm __timegm64
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __USE_MISC
|
#ifdef __USE_MISC
|
||||||
/* Miscellaneous functions many Unices inherited from the public domain
|
/* Miscellaneous functions many Unices inherited from the public domain
|
||||||
localtime package. These are included only for compatibility. */
|
localtime package. These are included only for compatibility. */
|
||||||
|
|
||||||
#ifndef __USE_TIME_BITS64
|
#ifndef __USE_TIME_BITS64
|
||||||
/* Like `mktime', but for TP represents Universal Time, not local time. */
|
|
||||||
extern time_t timegm (struct tm *__tp) __THROW;
|
|
||||||
/* Another name for `mktime'. */
|
/* Another name for `mktime'. */
|
||||||
extern time_t timelocal (struct tm *__tp) __THROW;
|
extern time_t timelocal (struct tm *__tp) __THROW;
|
||||||
#else
|
#else
|
||||||
# ifdef __REDIRECT_NTH
|
# ifdef __REDIRECT_NTH
|
||||||
extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64);
|
|
||||||
extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64);
|
extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64);
|
||||||
# else
|
|
||||||
# define timegm __timegm64
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user