mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-07 19:31:01 -04:00
add some timer macros for operating systems that dont support them
svn:r61
This commit is contained in:
parent
04153adb66
commit
7e4e52045e
@ -16,6 +16,15 @@
|
||||
/* Define if timeradd is defined in <sys/time.h> */
|
||||
#undef HAVE_TIMERADD
|
||||
#ifndef HAVE_TIMERADD
|
||||
#undef timerclear
|
||||
#undef timerisset
|
||||
#undef timercmp
|
||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
#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 timeradd(tvp, uvp, vvp) \
|
||||
do { \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user