Improve clock_gettime on osx
and some clean up
This commit is contained in:
committed by
Nekotekina
parent
009370f73c
commit
d0283265cc
+14
-5
@@ -68,12 +68,21 @@ inline int64_t __mulh(int64_t a, int64_t b)
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
int clock_gettime(int foo, struct timespec *ts);
|
||||
#define wxIsNaN(x) ((x) != (x))
|
||||
// XXX only supports a single timer
|
||||
#define TIMER_ABSTIME -1
|
||||
/* The opengroup spec isn't clear on the mapping from REALTIME to CALENDAR
|
||||
being appropriate or not.
|
||||
http://pubs.opengroup.org/onlinepubs/009695299/basedefs/time.h.html */
|
||||
#define CLOCK_REALTIME 1 // #define CALENDAR_CLOCK 1 from mach/clock_types.h
|
||||
#define CLOCK_MONOTONIC 0 // #define SYSTEM_CLOCK 0
|
||||
|
||||
#ifndef CLOCK_MONOTONIC
|
||||
#define CLOCK_MONOTONIC 0
|
||||
#endif /* !CLOCK_MONOTONIC */
|
||||
typedef int clockid_t;
|
||||
|
||||
/* the mach kernel uses struct mach_timespec, so struct timespec
|
||||
is loaded from <sys/_types/_timespec.h> for compatability */
|
||||
// struct timespec { time_t tv_sec; long tv_nsec; };
|
||||
|
||||
int clock_gettime(clockid_t clk_id, struct timespec *tp);
|
||||
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user