mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:34:57 +00:00
LibC: Define time*
macros before definitions
Otherwise, if an application defines its own macros, the implementations get messed up. This way we redefine those macros if they're set. This fixes the PHP port build.
This commit is contained in:
parent
8356ff283b
commit
ba776390b5
1 changed files with 13 additions and 13 deletions
|
@ -28,6 +28,13 @@ int utimes(char const* pathname, struct timeval const times[2]);
|
|||
int lutimes(char const* pathname, struct timeval const times[2]);
|
||||
int futimes(int fd, struct timeval const times[2]);
|
||||
|
||||
#define timeradd timeradd
|
||||
#define timersub timersub
|
||||
#define timerclear timerclear
|
||||
#define timerisset timerisset
|
||||
#define timercmp(tvp, uvp, cmp) \
|
||||
(((tvp)->tv_sec == (uvp)->tv_sec) ? ((tvp)->tv_usec cmp(uvp)->tv_usec) : ((tvp)->tv_sec cmp(uvp)->tv_sec))
|
||||
|
||||
static inline void timeradd(const struct timeval* a, const struct timeval* b, struct timeval* out)
|
||||
{
|
||||
out->tv_sec = a->tv_sec + b->tv_sec;
|
||||
|
@ -58,12 +65,12 @@ static inline int timerisset(const struct timeval* tv)
|
|||
return tv->tv_sec || tv->tv_usec;
|
||||
}
|
||||
|
||||
#define timeradd timeradd
|
||||
#define timersub timersub
|
||||
#define timerclear timerclear
|
||||
#define timerisset timerisset
|
||||
#define timercmp(tvp, uvp, cmp) \
|
||||
(((tvp)->tv_sec == (uvp)->tv_sec) ? ((tvp)->tv_usec cmp(uvp)->tv_usec) : ((tvp)->tv_sec cmp(uvp)->tv_sec))
|
||||
#define timespecadd timespecadd
|
||||
#define timespecsub timespecsub
|
||||
#define timespecclear timespecclear
|
||||
#define timespecisset timespecisset
|
||||
#define timespeccmp(ts, us, cmp) \
|
||||
(((ts)->tv_sec == (us)->tv_sec) ? ((ts)->tv_nsec cmp(us)->tv_nsec) : ((ts)->tv_sec cmp(us)->tv_sec))
|
||||
|
||||
static inline void timespecadd(const struct timespec* a, const struct timespec* b, struct timespec* out)
|
||||
{
|
||||
|
@ -107,11 +114,4 @@ static inline void TIMESPEC_TO_TIMEVAL(struct timeval* tv, const struct timespec
|
|||
tv->tv_usec = ts->tv_nsec / 1000;
|
||||
}
|
||||
|
||||
#define timespecadd timespecadd
|
||||
#define timespecsub timespecsub
|
||||
#define timespecclear timespecclear
|
||||
#define timespecisset timespecisset
|
||||
#define timespeccmp(ts, us, cmp) \
|
||||
(((ts)->tv_sec == (us)->tv_sec) ? ((ts)->tv_nsec cmp(us)->tv_nsec) : ((ts)->tv_sec cmp(us)->tv_sec))
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue