X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Ftime.h;h=3d94837205ad55d0f5a8b3ee63d3e622ea154fab;hb=759bf785a84bd56ed1b163594f3f66ade808c0e3;hp=16ec08aeb2b4c6a592d83b0005315d71d9602987;hpb=ab8f6a6e42ff893041f7545a23e6d6a0edde07fb;p=musl diff --git a/include/time.h b/include/time.h index 16ec08ae..3d948372 100644 --- a/include/time.h +++ b/include/time.h @@ -7,7 +7,9 @@ extern "C" { #include -#ifdef __cplusplus +#if __cplusplus >= 201103L +#define NULL nullptr +#elif defined(__cplusplus) #define NULL 0L #else #define NULL ((void*)0) @@ -35,8 +37,7 @@ extern "C" { #define __tm_zone tm_zone #endif -struct tm -{ +struct tm { int tm_sec; int tm_min; int tm_hour; @@ -78,8 +79,7 @@ char *ctime_r (const time_t *, char *); void tzset (void); -struct itimerspec -{ +struct itimerspec { struct timespec it_interval; struct timespec it_value; }; @@ -113,6 +113,8 @@ int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct iti int timer_gettime (timer_t, struct itimerspec *); int timer_getoverrun (timer_t); +extern char *tzname[2]; + #endif @@ -120,7 +122,6 @@ int timer_getoverrun (timer_t); char *strptime (const char *__restrict, const char *__restrict, struct tm *__restrict); extern int daylight; extern long timezone; -extern char *tzname[2]; extern int getdate_err; struct tm *getdate (const char *); #endif @@ -131,6 +132,34 @@ int stime(const time_t *); time_t timegm(struct tm *); #endif +#if _REDIR_TIME64 +__REDIR(time, __time64); +__REDIR(difftime, __difftime64); +__REDIR(mktime, __mktime64); +__REDIR(gmtime, __gmtime64); +__REDIR(localtime, __localtime64); +__REDIR(ctime, __ctime64); +__REDIR(timespec_get, __timespec_get_time64); +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) +__REDIR(gmtime_r, __gmtime64_r); +__REDIR(localtime_r, __localtime64_r); +__REDIR(ctime_r, __ctime64_r); +__REDIR(nanosleep, __nanosleep_time64); +__REDIR(clock_getres, __clock_getres_time64); +__REDIR(clock_gettime, __clock_gettime64); +__REDIR(clock_settime, __clock_settime64); +__REDIR(clock_nanosleep, __clock_nanosleep_time64); +__REDIR(timer_settime, __timer_settime64); +__REDIR(timer_gettime, __timer_gettime64); +#endif +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +__REDIR(stime, __stime64); +__REDIR(timegm, __timegm_time64); +#endif +#endif + #ifdef __cplusplus } #endif