From 2946c877b875855d5579ae2e5c254159b3bfda32 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 24 Oct 2010 14:44:40 +0000 Subject: remove ev_defgault inline function --- ev.h | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'ev.h') diff --git a/ev.h b/ev.h index ae82f76..4a2c9a4 100644 --- a/ev.h +++ b/ev.h @@ -510,6 +510,11 @@ void ev_set_allocator (void *(*cb)(void *ptr, long size)); void ev_set_syserr_cb (void (*cb)(const char *msg)); #if EV_MULTIPLICITY + +/* the default loop is the only one that handles signals and child watchers */ +/* you can call this as often as you like */ +struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0)); + EV_INLINE struct ev_loop * ev_default_loop_uc (void) { @@ -518,21 +523,10 @@ ev_default_loop_uc (void) return ev_default_loop_ptr; } -/* the default loop is the only one that handles signals and child watchers */ -/* you can call this as often as you like */ -EV_INLINE struct ev_loop * -ev_default_loop (unsigned int flags EV_CPP (= 0)) +EV_INLINE int +ev_is_default_loop (EV_P) { - struct ev_loop *loop = ev_default_loop_uc (); - - if (!loop) - { - extern struct ev_loop *ev_default_loop_init (unsigned int flags); - - loop = ev_default_loop_init (flags); - } - - return loop; + return EV_A == ev_default_loop_uc (); } /* create and destroy alternative loops that don't handle signals */ @@ -553,20 +547,16 @@ ev_now (void) return ev_rt_now; } -#endif /* multiplicity */ +/* looks weird, but ev_is_default_loop (EV_A) still works if this exists */ EV_INLINE int -ev_is_default_loop (EV_P) +ev_is_default_loop (void) { -#if EV_MULTIPLICITY - extern struct ev_loop *ev_default_loop_ptr; - - return !!(EV_A == ev_default_loop_ptr); -#else return 1; -#endif } +#endif /* multiplicity */ + void ev_default_destroy (void); /* destroy the default loop */ /* this needs to be called after fork, to duplicate the default loop */ /* if you create alternative loops you have to call ev_loop_fork on them */ -- cgit v1.2.3