So the risky thing here is that SOCKET is defined as u_int on win32 and UINT_PTR on win64. If we make this change, we will have tor_socket_t be unsigned on windows and signed everywhere else. Every place that currently checks for sockets being < 0 will instead have to use the SOCKET_OK macro.
That said, I'm okay doing this on 0.2.3.x if we can seriously audit everything that looks at a socket for correctness.
At this point the benefit isn't high enough to do the intptr -> socket transition in 0.2.3.x, and I'm not sure it will be. (If win128 makes SOCKET a 128-bit type, it'll probably make intptr_t 128-bit too, and vice versa. But just in case, checking the type size at compile time might be reasonable.)
Still, there are some more places we should be using the macros we have. See branch "bug4533_part1" in my public repo, which also adds a runtime test
< wanoskarnet> "(unsigned)(s) != INVALID_SOCKET" is never false for win64. SOCKET is unsigned and sizeof(SOCKET) is 8 bytes and INVALID_SOCKET defined as (SOCKET)(-1) so (unsigned)(intptr_t)(-1) never equal (SOCKET)(-1). 00000000FFFFFFFF != FFFFFFFFFFFFFFFF