Commit 38451247 authored by Jason Madden's avatar Jason Madden

drop the watcher macro, call start/stop through function pointers and fix a compiler warning.

parent 5b72d7cf
...@@ -188,7 +188,7 @@ static void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallback ...@@ -188,7 +188,7 @@ static void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallback
#undef DEFINE_CALLBACK #undef DEFINE_CALLBACK
#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ #define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \
static void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \ static void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \
struct PyGeventWatcherObject* watcher = GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \ struct PyGeventWatcherObject* watcher = (struct PyGeventWatcherObject*)GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \
gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \ gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \
} }
......
This diff is collapsed.
...@@ -131,6 +131,13 @@ cdef extern from "libev.h" nogil: ...@@ -131,6 +131,13 @@ cdef extern from "libev.h" nogil:
stat prev stat prev
double interval double interval
union ev_any_watcher:
ev_watcher w
ev_io io
ev_timer timer
ev_signal signal
ev_idle idle
int ev_version_major() int ev_version_major()
int ev_version_minor() int ev_version_minor()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment