#pragma once #include #include #define EV_MULTIPLICITY 1 #define EV_STAT_ENABLE 0 #define EV_PERIODIC_ENABLE 0 #define EV_SIGNAL_ENABLE 0 #define EV_CHILD_ENABLE 0 #define EV_IDLE_ENABLE 0 #define EV_PREPARE_ENABLE 0 #define EV_FORK_ENABLE 0 #define EV_CLEANUP_ENABLE 0 #define EV_EMBED_ENABLE 0 #include // Wrap common libev macros to ignore aliasing warnings. AL_IGNORE_WARNING("-Wstrict-aliasing") static inline void ev_init_nn(ev_watcher *ev, void (*callback)(struct ev_loop *, ev_watcher *, s32)) { ev_init(ev, callback); } #define ev_init_n(w, callback) ev_init_nn((ev_watcher *)w, (void (*)(struct ev_loop *, ev_watcher *, s32))callback) static inline bool ev_is_active_nn(ev_watcher *ev) { return ev_is_active(ev); } #define ev_is_active_n(w) ev_is_active_nn((ev_watcher *)w) static inline void ev_io_init_n(ev_io *io, void (*callback)(struct ev_loop *, ev_io *, s32), s32 fd, s32 events) { ev_io_init(io, callback, fd, events); } static inline void ev_timer_init_n(ev_timer *timer, void (*callback)(struct ev_loop *, ev_timer *, s32), s32 fd, s32 events) { ev_timer_init(timer, callback, fd, events); } static inline void ev_async_init_n(ev_async *asyn, void (*callback)(struct ev_loop *, ev_async *, s32)) { ev_async_init(asyn, callback); } AL_IGNORE_WARNING_END