diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | ev++.h | 2 | ||||
-rw-r--r-- | ev.c | 18 | ||||
-rw-r--r-- | ev.h | 15 | ||||
-rw-r--r-- | ev.pod | 22 | ||||
-rw-r--r-- | libev.m4 | 3 |
6 files changed, 34 insertions, 27 deletions
@@ -17,6 +17,7 @@ TODO: ABI??? API????? Changes??? - do not use sscanf to parse linux version number (smaller, faster, no sscanf dependency). - new EV_CHILD_ENABLE and EV_SIGNAL_ENABLE configurable settings. + - update libev.m4 HAVE_CLOCK_SYSCALL test for newwer glibcs. - add section on accept() problems to the manpage. 3.9 Thu Dec 31 07:59:59 CET 2009 @@ -227,7 +227,7 @@ namespace ev { ev_unref (EV_AX); } -#if EV_MINIMAL < 2 +#if EV_FEATURE_API unsigned int count () const throw () { return ev_loop_count (EV_AX); @@ -81,7 +81,7 @@ extern "C" { # ifndef EV_USE_NANOSLEEP # if HAVE_NANOSLEEP -# define EV_USE_NANOSLEEP 1 +# define EV_USE_NANOSLEEP EV_FEATURE_OS # else # define EV_USE_NANOSLEEP 0 # endif @@ -89,7 +89,7 @@ extern "C" { # ifndef EV_USE_SELECT # if HAVE_SELECT && HAVE_SYS_SELECT_H -# define EV_USE_SELECT 1 +# define EV_USE_SELECT EV_FEATURE_BACKENDS # else # define EV_USE_SELECT 0 # endif @@ -97,7 +97,7 @@ extern "C" { # ifndef EV_USE_POLL # if HAVE_POLL && HAVE_POLL_H -# define EV_USE_POLL 1 +# define EV_USE_POLL EV_FEATURE_BACKENDS # else # define EV_USE_POLL 0 # endif @@ -105,7 +105,7 @@ extern "C" { # ifndef EV_USE_EPOLL # if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H -# define EV_USE_EPOLL 1 +# define EV_USE_EPOLL EV_FEATURE_BACKENDS # else # define EV_USE_EPOLL 0 # endif @@ -113,7 +113,7 @@ extern "C" { # ifndef EV_USE_KQUEUE # if HAVE_KQUEUE && HAVE_SYS_EVENT_H -# define EV_USE_KQUEUE 1 +# define EV_USE_KQUEUE EV_FEATURE_BACKENDS # else # define EV_USE_KQUEUE 0 # endif @@ -121,7 +121,7 @@ extern "C" { # ifndef EV_USE_PORT # if HAVE_PORT_H && HAVE_PORT_CREATE -# define EV_USE_PORT 1 +# define EV_USE_PORT EV_FEATURE_BACKENDS # else # define EV_USE_PORT 0 # endif @@ -129,7 +129,7 @@ extern "C" { # ifndef EV_USE_INOTIFY # if HAVE_INOTIFY_INIT && HAVE_SYS_INOTIFY_H -# define EV_USE_INOTIFY 1 +# define EV_USE_INOTIFY EV_FEATURE_OS # else # define EV_USE_INOTIFY 0 # endif @@ -137,7 +137,7 @@ extern "C" { # ifndef EV_USE_SIGNALFD # if HAVE_SIGNALFD && HAVE_SYS_SIGNALFD_H -# define EV_USE_SIGNALFD 1 +# define EV_USE_SIGNALFD EV_FEATURE_OS # else # define EV_USE_SIGNALFD 0 # endif @@ -145,7 +145,7 @@ extern "C" { # ifndef EV_USE_EVENTFD # if HAVE_EVENTFD -# define EV_USE_EVENTFD 1 +# define EV_USE_EVENTFD EV_FEATURE_OS # else # define EV_USE_EVENTFD 0 # endif @@ -52,21 +52,22 @@ extern "C" { #define EV_FEATURE_CODE ((EV_FEATURES) & 1) #define EV_FEATURE_DATA ((EV_FEATURES) & 2) -#define EV_FEATURE_API ((EV_FEATURES) & 4) -#define EV_FEATURE_WATCHERS ((EV_FEATURES) & 8) -#define EV_FEATURE_BACKENDS ((EV_FEATURES) & 16) -#define EV_FEATURE_OS ((EV_FEATURES) & 32) +#define EV_FEATURE_CONFIG ((EV_FEATURES) & 4) +#define EV_FEATURE_API ((EV_FEATURES) & 8) +#define EV_FEATURE_WATCHERS ((EV_FEATURES) & 16) +#define EV_FEATURE_BACKENDS ((EV_FEATURES) & 32) +#define EV_FEATURE_OS ((EV_FEATURES) & 64) /* these priorities are inclusive, higher priorities will be called earlier */ #ifndef EV_MINPRI -# define EV_MINPRI (EV_FEATURE_API ? -2 : 0) +# define EV_MINPRI (EV_FEATURE_CONFIG ? -2 : 0) #endif #ifndef EV_MAXPRI -# define EV_MAXPRI (EV_FEATURE_API ? +2 : 0) +# define EV_MAXPRI (EV_FEATURE_CONFIG ? +2 : 0) #endif #ifndef EV_MULTIPLICITY -# define EV_MULTIPLICITY EV_FEATURE_API +# define EV_MULTIPLICITY EV_FEATURE_CONFIG #endif #ifndef EV_PERIODIC_ENABLE @@ -3893,9 +3893,6 @@ speed (but with the full API), you can define this symbol to request certain subsets of functionality. The default is to enable all features that can be enabled on the platform. -Note that using autoconf will usually override most of the features, so -using this symbol makes sense mostly when embedding libev. - A typical way to use this symbol is to define it to C<0> (or to a bitset with some broad features you want) and then selectively re-enable additional parts you want, for example if you want everything minimal, @@ -3936,23 +3933,25 @@ runtime. This enables priorities (sets C<EV_MAXPRI>=2 and C<EV_MINPRI>=-2), and enables multiplicity (C<EV_MULTIPLICITY>=1). -It also enables a lot of the "lesser used" core API functions. See C<ev.h> -for details on which parts of the API are still available without this +=item C<8> - full API + +This enables a lot of the "lesser used" API functions. See C<ev.h> for +details on which parts of the API are still available without this feature, and do not complain if this subset changes over time. -=item C<8> - enable all optional watcher types +=item C<16> - enable all optional watcher types Enables all optional watcher types. If you want to selectively enable only some watcher types other than I/O and timers (e.g. prepare, embed, async, child...) you can enable them manually by defining C<EV_watchertype_ENABLE> to C<1> instead. -=item C<16> - enable all backends +=item C<32> - enable all backends This enables all backends - without this feature, you need to enable at least one backend manually (C<EV_USE_SELECT> is a good choice). -=item C<32> - enable OS-specific "helper" APIs +=item C<64> - enable OS-specific "helper" APIs Enable inotify, eventfd, signalfd and similar OS-specific helper APIs by default. @@ -4105,8 +4104,13 @@ file. The usage in rxvt-unicode is simpler. It has a F<ev_cpp.h> header file that everybody includes and which overrides some configure choices: - #define EV_FEATURES 0 + #define EV_FEATURES 8 #define EV_USE_SELECT 1 + #define EV_PREPARE_ENABLE 1 + #define EV_IDLE_ENABLE 1 + #define EV_SIGNAL_ENABLE 1 + #define EV_CHILD_ENABLE 1 + #define EV_USE_STDEXCEPT 0 #define EV_CONFIG_H <config.h> #include "ev++.h" @@ -11,7 +11,8 @@ AC_CHECK_FUNC(clock_gettime, [], [ if test $(uname) = Linux; then AC_MSG_CHECKING(for clock_gettime syscall) AC_LINK_IFELSE([AC_LANG_PROGRAM( - [#include <syscall.h> + [#include <unistd.h> + #include <sys/syscall.h> #include <time.h>], [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])], [ac_have_clock_syscall=1 |