More fixes for Windows.
In particular, Windows does support many of the timer* macros, except timeradd and timersub.
This commit is contained in:
parent
d53384c2de
commit
75c619e372
3 changed files with 20 additions and 0 deletions
18
src/dropin.h
18
src/dropin.h
|
@ -45,4 +45,22 @@ extern int gettimeofday(struct timeval *, void *);
|
|||
extern int usleep(long long usec);
|
||||
#endif
|
||||
|
||||
#ifndef timeradd
|
||||
#define timeradd(a, b, r) do {\
|
||||
(r)->tv_sec = (a)->tv_sec + (b)->tv_sec;\
|
||||
(r)->tv_usec = (a)->tv_usec + (b)->tv_usec;\
|
||||
if((r)->tv_usec >= 1000000)\
|
||||
(r)->tv_sec++, (r)->tv_usec -= 1000000;\
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef timersub
|
||||
#define timersub(a, b, r) do {\
|
||||
(r)->tv_sec = (a)->tv_sec - (b)->tv_sec;\
|
||||
(r)->tv_usec = (a)->tv_usec - (b)->tv_usec;\
|
||||
if((r)->tv_usec < 1000000)\
|
||||
(r)->tv_sec--, (r)->tv_usec += 1000000;\
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* __DROPIN_H__ */
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "system.h"
|
||||
|
||||
#include "dropin.h"
|
||||
#include "event.h"
|
||||
#include "net.h"
|
||||
#include "utils.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "control.h"
|
||||
#include "device.h"
|
||||
#include "edge.h"
|
||||
#include "event.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "node.h"
|
||||
|
|
Loading…
Reference in a new issue