From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3125 invoked by alias); 11 Nov 2019 15:05:11 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 3084 invoked by uid 9119); 11 Nov 2019 15:05:10 -0000 Date: Mon, 11 Nov 2019 15:05:00 -0000 Message-ID: <20191111150510.3083.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Joseph Myers To: glibc-cvs@sourceware.org Subject: [glibc] Declare asctime_r, ctime_r, gmtime_r, localtime_r for C2X. X-Act-Checkin: glibc X-Git-Author: Joseph Myers X-Git-Refname: refs/heads/master X-Git-Oldrev: 258c242128a35e7fc17aff34c9dc23cd7576e88f X-Git-Newrev: 80a5f8b1569bdecd8d517ae312a98e3c8f224f4b X-SW-Source: 2019-q4/txt/msg00305.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=80a5f8b1569bdecd8d517ae312a98e3c8f224f4b commit 80a5f8b1569bdecd8d517ae312a98e3c8f224f4b Author: Joseph Myers Date: Mon Nov 11 15:04:48 2019 +0000 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 declares them. Tested for x86_64. Diff: --- time/time.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/time/time.h b/time/time.h index 7daaacc..05d9098 100644 --- a/time/time.h +++ b/time/time.h @@ -122,7 +122,7 @@ extern struct tm *gmtime (const time_t *__timer) __THROW; of *TIMER in the local timezone. */ 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, using *TP to store the result. */ 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. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; -#endif /* POSIX */ +#endif /* POSIX || C2X */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" 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))'. */ extern char *ctime (const time_t *__timer) __THROW; -#ifdef __USE_POSIX +#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) /* Reentrant versions of the above functions. */ /* 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)'. */ extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; -#endif /* POSIX */ +#endif /* POSIX || C2X */ /* Defined in localtime.c. */