+#define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */
+/*#define CLEANUP_INTERVAL (MAX_BLOCKTIME * 5.) /* how often to try to free memory and re-check fds */
+
+#if __GNUC__ >= 3
+# define expect(expr,value) __builtin_expect ((expr),(value))
+# define inline_size static inline /* inline for codesize */
+# if EV_MINIMAL
+# define noinline __attribute__ ((noinline))
+# define inline_speed static noinline
+# else
+# define noinline
+# define inline_speed static inline
+# endif
+#else
+# define expect(expr,value) (expr)
+# define inline_speed static
+# define inline_size static
+# define noinline
+#endif
+
+#define expect_false(expr) expect ((expr) != 0, 0)
+#define expect_true(expr) expect ((expr) != 0, 1)
+
+#define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
+#define ABSPRI(w) (((W)w)->priority - EV_MINPRI)
+
+#define EMPTY /* required for microsofts broken pseudo-c compiler */
+#define EMPTY2(a,b) /* used to suppress some warnings */
+
+typedef ev_watcher *W;
+typedef ev_watcher_list *WL;
+typedef ev_watcher_time *WT;
+
+static int have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */
+
+#ifdef _WIN32
+# include "ev_win32.c"
+#endif
+
+/*****************************************************************************/
+
+static void (*syserr_cb)(const char *msg);
+
+void
+ev_set_syserr_cb (void (*cb)(const char *msg))
+{
+ syserr_cb = cb;
+}
+
+static void noinline
+syserr (const char *msg)
+{
+ if (!msg)
+ msg = "(libev) system error";
+
+ if (syserr_cb)
+ syserr_cb (msg);
+ else
+ {
+ perror (msg);
+ abort ();
+ }
+}
+
+static void *(*alloc)(void *ptr, long size);
+
+void
+ev_set_allocator (void *(*cb)(void *ptr, long size))
+{
+ alloc = cb;
+}