2 ==================================================================
3 --- Makefile.am (revision 8794)
4 +++ Makefile.am (local)
6 AUTOMAKE_OPTIONS = foreign no-dependencies
8 -SUBDIRS = . sample test
10 EXTRA_DIST = acconfig.h event.h event-internal.h log.h evsignal.h event.3 \
11 kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
14 lib_LTLIBRARIES = libevent.la
16 -libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c
17 -libevent_la_LIBADD = @LTLIBOBJS@
22 +SYS_SRC = WIN32-Code/misc.c WIN32-Code/win32.c
23 +SYS_INCLUDES = -IWIN32-Code
27 +SUBDIRS = . sample test
34 +libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c $(SYS_SRC)
35 +libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
36 libevent_la_LDFLAGS = -release @VERSION@ -version-info 1:2:0
38 include_HEADERS = event.h
41 +INCLUDES = -Icompat $(SYS_INCLUDES)
46 ==================================================================
47 --- WIN32-Code/misc.c (revision 8794)
48 +++ WIN32-Code/misc.c (local)
50 #include <sys/timeb.h>
54 +/*our prototypes for timeval and timezone are in here, just in case the above
55 + headers don't have them*/
59 /****************************************************************************
61 * Function: gettimeofday(struct timeval *, struct timezone *)
64 ****************************************************************************/
66 +#ifndef HAVE_GETTIMEOFDAY
67 int gettimeofday(struct timeval *tv, struct timezone *tz) {
71 tv->tv_usec = ((int) tb.millitm) * 1000;
77 win_read(int fd, void *buf, unsigned int length)
79 ==================================================================
80 --- WIN32-Code/misc.h (revision 8794)
81 +++ WIN32-Code/misc.h (local)
89 +#ifndef HAVE_GETTIMEOFDAY
90 int gettimeofday(struct timeval *,struct timezone *);
94 === WIN32-Code/win32.c
95 ==================================================================
96 --- WIN32-Code/win32.c (revision 8794)
97 +++ WIN32-Code/win32.c (local)
99 /* MSDN says this is required to handle SIGFPE */
100 volatile double SIGFPE_REQ = 0.0f;
102 -int signal_handler(int sig);
103 +static void signal_handler(int sig);
105 void signal_process(void);
106 int signal_recalc(void);
112 -win32_insert(struct win32op *win32op, struct event *ev)
113 +win32_insert(void *op, struct event *ev)
115 + struct win32op *win32op = op;
118 if (ev->ev_events & EV_SIGNAL) {
123 -win32_del(struct win32op *win32op, struct event *ev)
124 +win32_del(void *op, struct event *ev)
126 + struct win32op *win32op = op;
129 if (ev->ev_events & EV_SIGNAL)
134 -win32_dispatch(struct event_base *base, struct win32op *win32op,
135 +win32_dispatch(struct event_base *base, void *op,
138 + struct win32op *win32op = op;
142 @@ -366,13 +370,11 @@
148 signal_handler(int sig)
158 ==================================================================
159 --- buffer.c (revision 8794)
162 u_char *data = EVBUFFER_DATA(buffer);
163 size_t len = EVBUFFER_LENGTH(buffer);
168 for (i = 0; i < len; i++) {
169 if (data[i] == '\r' || data[i] == '\n')
171 ==================================================================
172 --- configure.in (revision 8794)
173 +++ configure.in (local)
178 +dnl - check if the macro WIN32 is defined on this compiler.
179 +dnl - (this is how we check for a windows version of GCC)
180 +AC_MSG_CHECKING(for WIN32)
187 + bwin32=true; AC_MSG_RESULT(yes),
188 + bwin32=false; AC_MSG_RESULT(no),
191 +AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
193 dnl Checks for typedefs, structures, and compiler characteristics.
197 ==================================================================
198 --- evbuffer.c (revision 8794)
199 +++ evbuffer.c (local)
200 @@ -154,12 +154,20 @@
201 if (EVBUFFER_LENGTH(bufev->output)) {
202 res = evbuffer_write(bufev->output, fd);
205 +/*todo. evbuffer uses WriteFile when WIN32 is set. WIN32 system calls do not
206 + *set errno. thus this error checking is not portable*/
207 if (errno == EAGAIN ||
209 errno == EINPROGRESS)
212 what |= EVBUFFER_ERROR;
218 } else if (res == 0) {
220 what |= EVBUFFER_EOF;