manpage: stop mentioning the possibility that Tor has been built without eventdns...
[tor/rransom.git] / Win32Build / mingw / libevent-svn-mingw.diff
blobaf4ffbbbb51e804fda2b792578186f5eeaac6744
1 === Makefile.am
2 ==================================================================
3 --- Makefile.am (revision 8794)
4 +++ Makefile.am (local)
5 @@ -1,6 +1,5 @@
6 AUTOMAKE_OPTIONS = foreign no-dependencies
8 -SUBDIRS = . sample test
10 bin_SCRIPTS = event_rpcgen.py
12 @@ -22,18 +21,34 @@
14 lib_LTLIBRARIES = libevent.la
16 +if BUILD_WIN32
18 +SUBDIRS = . sample
19 +SYS_LIBS = -lws2_32
20 +SYS_SRC = WIN32-Code/misc.c WIN32-Code/win32.c
21 +SYS_INCLUDES = -IWIN32-Code
23 +else
25 +SUBDIRS = . sample test
26 +SYS_LIBS =
27 +SYS_SRC =
28 +SYS_INCLUDES =
30 +endif
32 libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c event_tagging.c \
33 - http.c evhttp.h http-internal.h evdns.c evdns.h
34 -libevent_la_LIBADD = @LTLIBOBJS@
35 + http.c evhttp.h http-internal.h evdns.c evdns.h $(SYS_SRC)
36 +libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
37 libevent_la_LDFLAGS = -release @VERSION@ -version-info 1:3:0
39 include_HEADERS = event.h evhttp.h evdns.h
41 -INCLUDES = -Icompat
42 +INCLUDES = -Icompat $(SYS_INCLUDES)
44 man_MANS = event.3
46 verify: libevent.la
47 - cd $(srcdir)/test && make verify
48 + cd $(srcdir)/test && make verify
50 DISTCLEANFILES = *~
51 === WIN32-Code/misc.c
52 ==================================================================
53 --- WIN32-Code/misc.c (revision 8794)
54 +++ WIN32-Code/misc.c (local)
55 @@ -4,6 +4,12 @@
56 #include <sys/timeb.h>
57 #include <time.h>
59 +#ifdef __GNUC__
60 +/*our prototypes for timeval and timezone are in here, just in case the above
61 + headers don't have them*/
62 +#include "misc.h"
63 +#endif
65 /****************************************************************************
67 * Function: gettimeofday(struct timeval *, struct timezone *)
68 === WIN32-Code/misc.h
69 ==================================================================
70 --- WIN32-Code/misc.h (revision 8794)
71 +++ WIN32-Code/misc.h (local)
72 @@ -1,6 +1,9 @@
73 #ifndef MISC_H
74 #define MISC_H
76 +struct timezone;
77 +struct timeval;
79 int gettimeofday(struct timeval *,struct timezone *);
81 #endif
82 === WIN32-Code/win32.c
83 ==================================================================
84 --- WIN32-Code/win32.c (revision 8794)
85 +++ WIN32-Code/win32.c (local)
86 @@ -60,7 +60,8 @@
87 /* MSDN says this is required to handle SIGFPE */
88 volatile double SIGFPE_REQ = 0.0f;
90 -int signal_handler(int sig);
91 +static void signal_handler(int sig);
93 void signal_process(void);
94 int signal_recalc(void);
96 @@ -207,8 +208,9 @@
99 int
100 -win32_insert(struct win32op *win32op, struct event *ev)
101 +win32_insert(void *op, struct event *ev)
103 + struct win32op *win32op = op;
104 int i;
106 if (ev->ev_events & EV_SIGNAL) {
107 @@ -253,8 +255,9 @@
111 -win32_del(struct win32op *win32op, struct event *ev)
112 +win32_del(void *op, struct event *ev)
114 + struct win32op *win32op = op;
115 int i, found;
117 if (ev->ev_events & EV_SIGNAL)
118 @@ -304,9 +307,10 @@
122 -win32_dispatch(struct event_base *base, struct win32op *win32op,
123 +win32_dispatch(struct event_base *base, void *op,
124 struct timeval *tv)
126 + struct win32op *win32op = op;
127 int res = 0;
128 int i;
129 int fd_count;
130 @@ -389,13 +393,11 @@
131 free(win32op);
134 -static int
135 +static void
136 signal_handler(int sig)
138 evsigcaught[sig]++;
139 signal_caught = 1;
141 - return 0;
145 === buffer.c
146 ==================================================================
147 --- buffer.c (revision 8794)
148 +++ buffer.c (local)
149 @@ -197,7 +197,7 @@
150 u_char *data = EVBUFFER_DATA(buffer);
151 size_t len = EVBUFFER_LENGTH(buffer);
152 char *line;
153 - u_int i;
154 + unsigned int i;
156 for (i = 0; i < len; i++) {
157 if (data[i] == '\r' || data[i] == '\n')
158 === configure.in
159 ==================================================================
160 --- configure.in (revision 8794)
161 +++ configure.in (local)
162 @@ -111,6 +111,22 @@
166 +dnl - check if the macro WIN32 is defined on this compiler.
167 +dnl - (this is how we check for a windows version of GCC)
168 +AC_MSG_CHECKING(for WIN32)
169 +AC_TRY_COMPILE(,
171 + #ifndef WIN32
172 + #error
173 + #endif
174 + ],
175 + bwin32=true; AC_MSG_RESULT(yes),
176 + bwin32=false; AC_MSG_RESULT(no),
179 +AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
182 dnl Checks for typedefs, structures, and compiler characteristics.
183 AC_C_CONST
184 AC_C_INLINE
185 === evbuffer.c
186 ==================================================================
187 --- evbuffer.c (revision 8794)
188 +++ evbuffer.c (local)
189 @@ -163,12 +162,20 @@
190 if (EVBUFFER_LENGTH(bufev->output)) {
191 res = evbuffer_write(bufev->output, fd);
192 if (res == -1) {
193 +#ifndef WIN32
194 +/*todo. evbuffer uses WriteFile when WIN32 is set. WIN32 system calls do not
195 + *set errno. thus this error checking is not portable*/
196 if (errno == EAGAIN ||
197 errno == EINTR ||
198 errno == EINPROGRESS)
199 goto reschedule;
200 /* error case */
201 what |= EVBUFFER_ERROR;
203 +#else
204 + goto reschedule;
205 +#endif
207 } else if (res == 0) {
208 /* eof case */
209 what |= EVBUFFER_EOF;