… | |
… | |
57 | # endif |
57 | # endif |
58 | # ifndef EV_USE_MONOTONIC |
58 | # ifndef EV_USE_MONOTONIC |
59 | # define EV_USE_MONOTONIC 1 |
59 | # define EV_USE_MONOTONIC 1 |
60 | # endif |
60 | # endif |
61 | # endif |
61 | # endif |
|
|
62 | # elif !defined(EV_USE_CLOCK_SYSCALL) |
|
|
63 | # define EV_USE_CLOCK_SYSCALL 0 |
62 | # endif |
64 | # endif |
63 | |
65 | |
64 | # if HAVE_CLOCK_GETTIME |
66 | # if HAVE_CLOCK_GETTIME |
65 | # ifndef EV_USE_MONOTONIC |
67 | # ifndef EV_USE_MONOTONIC |
66 | # define EV_USE_MONOTONIC 1 |
68 | # define EV_USE_MONOTONIC 1 |
… | |
… | |
324 | |
326 | |
325 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
327 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
326 | /* which makes programs even slower. might work on other unices, too. */ |
328 | /* which makes programs even slower. might work on other unices, too. */ |
327 | #if EV_USE_CLOCK_SYSCALL |
329 | #if EV_USE_CLOCK_SYSCALL |
328 | # include <syscall.h> |
330 | # include <syscall.h> |
|
|
331 | # ifdef SYS_clock_gettime |
329 | # define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts)) |
332 | # define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts)) |
330 | # undef EV_USE_MONOTONIC |
333 | # undef EV_USE_MONOTONIC |
331 | # define EV_USE_MONOTONIC 1 |
334 | # define EV_USE_MONOTONIC 1 |
|
|
335 | # else |
|
|
336 | # undef EV_USE_CLOCK_SYSCALL |
|
|
337 | # define EV_USE_CLOCK_SYSCALL 0 |
|
|
338 | # endif |
332 | #endif |
339 | #endif |
333 | |
340 | |
334 | #if EV_USE_EVENTFD |
341 | #if EV_USE_EVENTFD |
335 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
342 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
336 | # include <stdint.h> |
343 | # include <stdint.h> |