aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2021-05-18 19:47:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2021-05-18 19:47:49 +0000
commit8382f4c3e5daf28af1aba0743aa3d62c7490bbf3 (patch)
treec6feb7b1beca26ddf610bda8f0f13b939d9e4a02 /time
parentaf46a4d638930f940c9eb0064727268e1cac900d (diff)
downloadglibc-8382f4c3e5daf28af1aba0743aa3d62c7490bbf3.tar
glibc-8382f4c3e5daf28af1aba0743aa3d62c7490bbf3.tar.gz
glibc-8382f4c3e5daf28af1aba0743aa3d62c7490bbf3.tar.bz2
glibc-8382f4c3e5daf28af1aba0743aa3d62c7490bbf3.zip
Do not declare asctime_r and ctime_r for C2X
ISO C2X added the asctime_r, ctime_r, gmtime_r and localtime_r functions from POSIX. It's now removed asctime_r and ctime_r again, reflecting that they are marked obsolescent in POSIX; update glibc's time.h accordingly. The same change that removed those two functions from C2X also marked asctime and ctime as deprecated (reflecting how POSIX shows them as obsolescent), i.e. using the [[deprecated]] attribute in the prototypes shown in C2X. It's less clear if we should explicitly deprecate those functions like that in the glibc headers; this patch does nothing regarding such a deprecation (there's no normative requirement from C2X showing the functions as deprecated). Tested for x86_64 and x86.
Diffstat (limited to 'time')
-rw-r--r--time/time.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/time/time.h b/time/time.h
index 5a7f419905..e255db9772 100644
--- a/time/time.h
+++ b/time/time.h
@@ -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;
-#if defined __USE_POSIX || __GLIBC_USE (ISOC2X)
+#ifdef __USE_POSIX
/* 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 || C2X */
+#endif /* POSIX */
/* Defined in localtime.c. */