Declare asctime_r, ctime_r, gmtime_r, localtime_r for C2X.

C2X adds the asctime_r, ctime_r, gmtime_r and localtime_r functions.
This patch duly adds __GLIBC_USE (ISOC2X) to the conditions under
which <time.h> declares them.

Tested for x86_64.
This commit is contained in:
Joseph Myers 2019-11-11 15:04:48 +00:00
parent 258c242128
commit 80a5f8b156
1 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
of *TIMER in the local timezone. */ of *TIMER in the local timezone. */
extern struct tm *localtime (const time_t *__timer) __THROW; extern struct tm *localtime (const time_t *__timer) __THROW;
#ifdef __USE_POSIX #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
/* Return the `struct tm' representation of *TIMER in UTC, /* Return the `struct tm' representation of *TIMER in UTC,
using *TP to store the result. */ using *TP to store the result. */
extern struct tm *gmtime_r (const time_t *__restrict __timer, extern struct tm *gmtime_r (const time_t *__restrict __timer,
@ -132,7 +132,7 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
using *TP to store the result. */ using *TP to store the result. */
extern struct tm *localtime_r (const time_t *__restrict __timer, extern struct tm *localtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) __THROW; struct tm *__restrict __tp) __THROW;
#endif /* POSIX */ #endif /* POSIX || C2X */
/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
that is the representation of TP in this format. */ that is the representation of TP in this format. */
@ -141,7 +141,7 @@ extern char *asctime (const struct tm *__tp) __THROW;
/* Equivalent to `asctime (localtime (timer))'. */ /* Equivalent to `asctime (localtime (timer))'. */
extern char *ctime (const time_t *__timer) __THROW; extern char *ctime (const time_t *__timer) __THROW;
#ifdef __USE_POSIX #if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
/* Reentrant versions of the above functions. */ /* Reentrant versions of the above functions. */
/* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@ -152,7 +152,7 @@ extern char *asctime_r (const struct tm *__restrict __tp,
/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */
extern char *ctime_r (const time_t *__restrict __timer, extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) __THROW; char *__restrict __buf) __THROW;
#endif /* POSIX */ #endif /* POSIX || C2X */
/* Defined in localtime.c. */ /* Defined in localtime.c. */