diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-23 00:17:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-23 00:17:48 -0400 |
commit | cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd (patch) | |
tree | f720f8ec3f8dcc065ea47b2c10c1e2885403e082 /src/common/compat_libevent.h | |
parent | 1ba1bdee4bd8f3c00e603fe9b0fd2f14eeb60466 (diff) | |
download | tor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.tar.gz tor-cfeafe5e77c9dd5587b1ec553eb1065f0bf841fd.zip |
Use a 64-bit type to hold sockets on win64.
On win64, sockets are of type UINT_PTR; on win32 they're u_int;
elsewhere they're int. The correct windows way to check a socket for
being set is to compare it with INVALID_SOCKET; elsewhere you see if
it is negative.
On Libevent 2, all callbacks take sockets as evutil_socket_t; we've
been passing them int.
This patch should fix compilation and correctness when built for
64-bit windows. Fixes bug 3270.
Diffstat (limited to 'src/common/compat_libevent.h')
-rw-r--r-- | src/common/compat_libevent.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h index fdf5e0a18f..1decc8d5f9 100644 --- a/src/common/compat_libevent.h +++ b/src/common/compat_libevent.h @@ -9,11 +9,15 @@ struct event; struct event_base; + #ifdef HAVE_EVENT2_EVENT_H #include <event2/util.h> #else +#ifndef EVUTIL_SOCKET_DEFINED +#define EVUTIL_SOCKET_DEFINED #define evutil_socket_t int #endif +#endif void configure_libevent_logging(void); void suppress_libevent_log_msg(const char *msg); |