… | |
… | |
5 | /*#include <netinet/in.h>*/ |
5 | /*#include <netinet/in.h>*/ |
6 | |
6 | |
7 | #define EV_PROTOTYPES 1 |
7 | #define EV_PROTOTYPES 1 |
8 | #include "EV/EVAPI.h" |
8 | #include "EV/EVAPI.h" |
9 | |
9 | |
|
|
10 | /* due to bugs in OS X we have to use libev/ explicitly here */ |
10 | #include "ev.c" |
11 | #include "libev/ev.c" |
11 | #include "event.c" |
12 | #include "event.c" |
12 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
13 | #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 |
|
|
14 | #if !defined (WIN32) && !defined(__CYGWIN__) |
13 | #define HAVE_STRUCT_IN6_ADDR 1 |
15 | # define HAVE_STRUCT_IN6_ADDR 1 |
|
|
16 | #endif |
14 | #undef HAVE_STRTOK_R |
17 | #undef HAVE_STRTOK_R |
15 | #undef strtok_r |
18 | #undef strtok_r |
16 | #define strtok_r fake_strtok_r |
19 | #define strtok_r fake_strtok_r |
17 | #include "evdns.c" |
20 | #include "evdns.c" |
|
|
21 | |
|
|
22 | #ifndef WIN32 |
|
|
23 | # include <pthread.h> |
|
|
24 | #endif |
18 | |
25 | |
19 | typedef int Signal; |
26 | typedef int Signal; |
20 | |
27 | |
21 | static struct EVAPI evapi; |
28 | static struct EVAPI evapi; |
22 | |
29 | |
… | |
… | |
314 | |
321 | |
315 | sv_setiv (sv, (IV)&evapi); |
322 | sv_setiv (sv, (IV)&evapi); |
316 | SvREADONLY_on (sv); |
323 | SvREADONLY_on (sv); |
317 | } |
324 | } |
318 | |
325 | |
|
|
326 | #ifndef WIN32 |
319 | pthread_atfork (0, 0, ev_default_fork); |
327 | pthread_atfork (0, 0, ev_default_fork); |
|
|
328 | #endif |
320 | } |
329 | } |
321 | |
330 | |
322 | NV ev_now () |
331 | NV ev_now () |
323 | |
332 | |
324 | int ev_method () |
333 | int ev_method () |