Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 17 Apr 2023 21:52:41 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 divers headers 04/17] C23: add timegm, gmtime_r and
 localtime_r to time.h in C23 mode

These are already present in musl, only they had been protected under
some POSIX or BSD macros. Make them available generally.

Their names were not reserved previously, so there are potential
naming conflicts with application code.
---
 include/time.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/time.h b/include/time.h
index 3d948372..e94b3a01 100644
--- a/include/time.h
+++ b/include/time.h
@@ -66,14 +66,16 @@ int timespec_get(struct timespec *, int);
 
 #define TIME_UTC 1
 
+struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict);
+struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
+time_t timegm(struct tm *);
+
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  || defined(_BSD_SOURCE)
 
 size_t strftime_l (char *  __restrict, size_t, const char *  __restrict, const struct tm *  __restrict, locale_t);
 
-struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict);
-struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
 char *asctime_r (const struct tm *__restrict, char *__restrict);
 char *ctime_r (const time_t *, char *);
 
@@ -129,7 +131,6 @@ struct tm *getdate (const char *);
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 int stime(const time_t *);
-time_t timegm(struct tm *);
 #endif
 
 #if _REDIR_TIME64
-- 
2.34.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.