summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes7
-rw-r--r--ev.c2
-rw-r--r--ev.h2
-rw-r--r--ev.pod3
-rw-r--r--ev_vars.h4
5 files changed, 11 insertions, 7 deletions
diff --git a/Changes b/Changes
index 9aea67e..ff96ff3 100644
--- a/Changes
+++ b/Changes
@@ -5,8 +5,11 @@ TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone)
TODO: document WSA_EV_USE_SOCKET in win32 part
TODO: ^ OR use WSASend/WSARecv on the handle, which always works
-TODO: throw() for most ev.h functions
-TODO: assert on fd watcher linked list pointint to itself
+TODO: assert on fd watcher linked list pointing to itself
+ - add throw() to all libev functions that cannot throw exceptions, for
+ further code size decrease when compiling for C++.
+ - add throw () to callbacks that must not throw exceptions (allocator,
+ syserr, loop acquire/release, periodic reschedule cbs).
- fix event_base_loop return code, add event_get_callback, event_base_new,
event_base_get_method calls to improve libevent 1.x emulation and add
some libevent 2.x funcitonality (based on a patch by Jeff Davey).
diff --git a/ev.c b/ev.c
index 98e9024..cc8285d 100644
--- a/ev.c
+++ b/ev.c
@@ -2321,7 +2321,7 @@ loop_init (EV_P_ unsigned int flags) EV_THROW
/* free up a loop structure */
void ecb_cold
-ev_loop_destroy (EV_P) EV_THROW
+ev_loop_destroy (EV_P)
{
int i;
diff --git a/ev.h b/ev.h
index 8cf95de..a8973ab 100644
--- a/ev.h
+++ b/ev.h
@@ -595,7 +595,7 @@ ev_is_default_loop (void) EV_THROW
#endif /* multiplicity */
/* destroy event loops, also works for the default loop */
-EV_API_DECL void ev_loop_destroy (EV_P) EV_THROW;
+EV_API_DECL void ev_loop_destroy (EV_P);
/* this needs to be called after fork, to duplicate the loop */
/* when you want to re-use it in the child */
diff --git a/ev.pod b/ev.pod
index f258999..6659cdd 100644
--- a/ev.pod
+++ b/ev.pod
@@ -3923,7 +3923,8 @@ and C++ you can use the C<EV_THROW> macro for this:
ev_set_syserr_cb (fatal_error);
The only API functions that can currently throw exceptions are C<ev_run>,
-C<ev_inoke> and C<ev_invoke_pending>.
+C<ev_inoke>, C<ev_invoke_pending> and C<ev_loop_destroy> (the latter
+because it runs cleanup watchers).
Throwing exceptions in watcher callbacks is only supported if libev itself
is compiled with a C++ compiler or your C and C++ environments allow
diff --git a/ev_vars.h b/ev_vars.h
index 667a986..5cd26d0 100644
--- a/ev_vars.h
+++ b/ev_vars.h
@@ -196,8 +196,8 @@ VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
VARx(void *, userdata)
-VAR (release_cb, void (*release_cb)(EV_P))
-VAR (acquire_cb, void (*acquire_cb)(EV_P))
+VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)
+VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)
VAR (invoke_cb , void (*invoke_cb) (EV_P))
#endif