From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1105) id A7E4D3834F2E; Mon, 6 Jun 2022 14:47:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7E4D3834F2E 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 timegm for ISO C2X X-Act-Checkin: glibc X-Git-Author: Joseph Myers X-Git-Refname: refs/heads/master X-Git-Oldrev: 603e5c8ba7257483c162cabb06eb6f79096429b6 X-Git-Newrev: 828c72519f49b16b989886ef4f66859d12c46aa9 Message-Id: <20220606144717.A7E4D3834F2E@sourceware.org> Date: Mon, 6 Jun 2022 14:47:17 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2022 14:47:17 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=828c72519f49b16b989886ef4f66859d12c46aa9 commit 828c72519f49b16b989886ef4f66859d12c46aa9 Author: Joseph Myers Date: Mon Jun 6 14:47:03 2022 +0000 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 accordingly. Tested for x86_64. Diff: --- time/time.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/time/time.h b/time/time.h index 2cf89e6222..d18089116e 100644 --- a/time/time.h +++ b/time/time.h @@ -240,21 +240,30 @@ extern long int timezone; ((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 /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ #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'. */ extern time_t timelocal (struct tm *__tp) __THROW; #else # ifdef __REDIRECT_NTH -extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64); extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64); -# else -# define timegm __timegm64 # endif #endif