ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.273 by root, Mon Nov 3 14:27:06 2008 UTC vs.
Revision 1.274 by root, Thu Nov 20 00:35:10 2008 UTC

47# include EV_CONFIG_H 47# include EV_CONFIG_H
48# else 48# else
49# include "config.h" 49# include "config.h"
50# endif 50# endif
51 51
52# if HAVE_CLOCK_SYSCALL
53# ifndef EV_USE_CLOCK_SYSCALL
54# define EV_USE_CLOCK_SYSCALL 1
55# ifndef EV_USE_REALTIME
56# define EV_USE_REALTIME 0
57# endif
58# ifndef EV_USE_MONOTONIC
59# define EV_USE_MONOTONIC 1
60# endif
61# endif
62# endif
63
52# if HAVE_CLOCK_GETTIME 64# if HAVE_CLOCK_GETTIME
53# ifndef EV_USE_MONOTONIC 65# ifndef EV_USE_MONOTONIC
54# define EV_USE_MONOTONIC 1 66# define EV_USE_MONOTONIC 1
55# endif 67# endif
56# ifndef EV_USE_REALTIME 68# ifndef EV_USE_REALTIME
164# endif 176# endif
165#endif 177#endif
166 178
167/* this block tries to deduce configuration from header-defined symbols and defaults */ 179/* this block tries to deduce configuration from header-defined symbols and defaults */
168 180
181#ifndef EV_USE_CLOCK_SYSCALL
182# if __linux && __GLIBC__ >= 2
183# define EV_USE_CLOCK_SYSCALL 1
184# else
185# define EV_USE_CLOCK_SYSCALL 0
186# endif
187#endif
188
169#ifndef EV_USE_MONOTONIC 189#ifndef EV_USE_MONOTONIC
170# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 190# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
171# define EV_USE_MONOTONIC 1 191# define EV_USE_MONOTONIC 1
172# else 192# else
173# define EV_USE_MONOTONIC 0 193# define EV_USE_MONOTONIC 0
298# endif 318# endif
299#endif 319#endif
300 320
301#if EV_SELECT_IS_WINSOCKET 321#if EV_SELECT_IS_WINSOCKET
302# include <winsock.h> 322# include <winsock.h>
323#endif
324
325/* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */
326/* which makes programs even slower. might work on other unices, too. */
327#if EV_USE_CLOCK_SYSCALL
328# include <syscall.h>
329# define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts))
330# undef EV_USE_MONOTONIC
331# define EV_USE_MONOTONIC 1
303#endif 332#endif
304 333
305#if EV_USE_EVENTFD 334#if EV_USE_EVENTFD
306/* our minimum requirement is glibc 2.7 which has the stub, but not the header */ 335/* our minimum requirement is glibc 2.7 which has the stub, but not the header */
307# include <stdint.h> 336# include <stdint.h>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines