From dea0720dadea8f3915901833115726f4ba0d48f4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 17 Jan 2012 16:38:47 -0500 Subject: Warn if sizeof(tor_socket_t) != sizeof(SOCKET) --- src/common/compat.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common') diff --git a/src/common/compat.c b/src/common/compat.c index 7f8903733b..1f9066d20a 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2889,6 +2889,11 @@ network_init(void) log_warn(LD_NET,"Error initializing windows network layer: code was %d",r); return -1; } + if (sizeof(SOCKET) != sizeof(tor_socket_t)) { + log_warn(LD_BUG,"The tor_socket_t type does not match SOCKET in size; Tor " + "might not work. (Sizes are %d and %d respectively.)", + (int)sizeof(tor_socket_t), (int)sizeof(SOCKET)); + } /* WSAData.iMaxSockets might show the max sockets we're allowed to use. * We might use it to complain if we're trying to be a server but have * too few sockets available. */ -- cgit v1.2.3-54-g00ecf