diff options
Diffstat (limited to 'lib/time.in.h')
-rw-r--r-- | lib/time.in.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/time.in.h b/lib/time.in.h index a0e67f76b29..3f9af920e34 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -112,12 +112,24 @@ struct __time_t_must_be_integral { /* Set *TS to the current time, and return BASE. Upon failure, return 0. */ # if @GNULIB_TIMESPEC_GET@ -# if ! @HAVE_TIMESPEC_GET@ +# if @REPLACE_TIMESPEC_GET@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef timespec_get +# define timespec_get rpl_timespec_get +# endif +_GL_FUNCDECL_RPL (timespec_get, int, (struct timespec *ts, int base) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (timespec_get, int, (struct timespec *ts, int base)); +# else +# if !@HAVE_TIMESPEC_GET@ _GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base) _GL_ARG_NONNULL ((1))); -# endif +# endif _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); +# endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (timespec_get); +# endif # endif /* Set *TS to the current time resolution, and return BASE. @@ -131,6 +143,20 @@ _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); _GL_CXXALIASWARN (timespec_getres); # endif +/* Return the number of seconds that have elapsed since the Epoch. */ +# if @GNULIB_TIME@ +# if @REPLACE_TIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define time rpl_time +# endif +_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp)); +_GL_CXXALIAS_RPL (time, time_t, (time_t *__tp)); +# else +_GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); +# endif +_GL_CXXALIASWARN (time); +# endif + /* Sleep for at least RQTP seconds unless interrupted, If interrupted, return -1 and store the remaining time into RMTP. See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */ @@ -315,6 +341,7 @@ _GL_CXXALIASWARN (strptime); # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define ctime rpl_ctime # endif +_GL_ATTRIBUTE_DEPRECATED _GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp)); @@ -422,7 +449,9 @@ _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (timegm); +# endif # endif /* Encourage applications to avoid unsafe functions that can overrun |