… | |
… | |
201 | # include <sys/wait.h> |
201 | # include <sys/wait.h> |
202 | # include <unistd.h> |
202 | # include <unistd.h> |
203 | #else |
203 | #else |
204 | # include <io.h> |
204 | # include <io.h> |
205 | # define WIN32_LEAN_AND_MEAN |
205 | # define WIN32_LEAN_AND_MEAN |
|
|
206 | # include <winsock2.h> |
206 | # include <windows.h> |
207 | # include <windows.h> |
207 | # include <winsock2.h> |
|
|
208 | # ifndef EV_SELECT_IS_WINSOCKET |
208 | # ifndef EV_SELECT_IS_WINSOCKET |
209 | # define EV_SELECT_IS_WINSOCKET 1 |
209 | # define EV_SELECT_IS_WINSOCKET 1 |
210 | # endif |
210 | # endif |
211 | # undef EV_AVOID_STDIO |
211 | # undef EV_AVOID_STDIO |
212 | #endif |
212 | #endif |
… | |
… | |
409 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
409 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
410 | # ifndef IN_DONT_FOLLOW |
410 | # ifndef IN_DONT_FOLLOW |
411 | # undef EV_USE_INOTIFY |
411 | # undef EV_USE_INOTIFY |
412 | # define EV_USE_INOTIFY 0 |
412 | # define EV_USE_INOTIFY 0 |
413 | # endif |
413 | # endif |
414 | #endif |
|
|
415 | |
|
|
416 | #if EV_SELECT_IS_WINSOCKET |
|
|
417 | # include <winsock.h> |
|
|
418 | #endif |
414 | #endif |
419 | |
415 | |
420 | #if EV_USE_EVENTFD |
416 | #if EV_USE_EVENTFD |
421 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
417 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
422 | # include <stdint.h> |
418 | # include <stdint.h> |
… | |
… | |
1914 | { |
1910 | { |
1915 | char dummy[4]; |
1911 | char dummy[4]; |
1916 | #ifdef _WIN32 |
1912 | #ifdef _WIN32 |
1917 | WSABUF buf; |
1913 | WSABUF buf; |
1918 | DWORD recvd; |
1914 | DWORD recvd; |
|
|
1915 | DWORD flags = 0; |
1919 | buf.buf = dummy; |
1916 | buf.buf = dummy; |
1920 | buf.len = sizeof (dummy); |
1917 | buf.len = sizeof (dummy); |
1921 | WSARecv (EV_FD_TO_WIN32_HANDLE (evpipe [0]), &buf, 1, &recvd, 0, 0, 0); |
1918 | WSARecv (EV_FD_TO_WIN32_HANDLE (evpipe [0]), &buf, 1, &recvd, &flags, 0, 0); |
1922 | #else |
1919 | #else |
1923 | read (evpipe [0], &dummy, sizeof (dummy)); |
1920 | read (evpipe [0], &dummy, sizeof (dummy)); |
1924 | #endif |
1921 | #endif |
1925 | } |
1922 | } |
1926 | } |
1923 | } |
… | |
… | |
2563 | #if EV_FEATURE_API |
2560 | #if EV_FEATURE_API |
2564 | void ecb_cold |
2561 | void ecb_cold |
2565 | ev_verify (EV_P) EV_THROW |
2562 | ev_verify (EV_P) EV_THROW |
2566 | { |
2563 | { |
2567 | #if EV_VERIFY |
2564 | #if EV_VERIFY |
2568 | int i, j; |
2565 | int i; |
2569 | WL w, w2; |
2566 | WL w, w2; |
2570 | |
2567 | |
2571 | assert (activecnt >= -1); |
2568 | assert (activecnt >= -1); |
2572 | |
2569 | |
2573 | assert (fdchangemax >= fdchangecnt); |
2570 | assert (fdchangemax >= fdchangecnt); |
2574 | for (i = 0; i < fdchangecnt; ++i) |
2571 | for (i = 0; i < fdchangecnt; ++i) |
2575 | assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0)); |
2572 | assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0)); |
2576 | |
2573 | |
2577 | assert (anfdmax >= 0); |
2574 | assert (anfdmax >= 0); |
2578 | for (i = j = 0; i < anfdmax; ++i) |
2575 | for (i = 0; i < anfdmax; ++i) |
|
|
2576 | { |
|
|
2577 | int j = 0; |
|
|
2578 | |
2579 | for (w = w2 = anfds [i].head; w; w = w->next) |
2579 | for (w = w2 = anfds [i].head; w; w = w->next) |
2580 | { |
2580 | { |
2581 | verify_watcher (EV_A_ (W)w); |
2581 | verify_watcher (EV_A_ (W)w); |
2582 | |
2582 | |
2583 | if (j++ & 1) |
2583 | if (j++ & 1) |
2584 | { |
2584 | { |
2585 | assert (("libev: io watcher list contains a loop", w != w2)); |
2585 | assert (("libev: io watcher list contains a loop", w != w2)); |
2586 | w2 = w2->next; |
2586 | w2 = w2->next; |
2587 | } |
2587 | } |
2588 | |
2588 | |
2589 | assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); |
2589 | assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); |
2590 | assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); |
2590 | assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); |
2591 | } |
2591 | } |
|
|
2592 | } |
2592 | |
2593 | |
2593 | assert (timermax >= timercnt); |
2594 | assert (timermax >= timercnt); |
2594 | verify_heap (EV_A_ timers, timercnt); |
2595 | verify_heap (EV_A_ timers, timercnt); |
2595 | |
2596 | |
2596 | #if EV_PERIODIC_ENABLE |
2597 | #if EV_PERIODIC_ENABLE |