]> granicus.if.org Git - libevent/commitdiff
The Windows socket type is defined as SOCKET.
authorbillsegall <bill@segall.net>
Wed, 16 Dec 2015 01:17:36 +0000 (11:17 +1000)
committerbillsegall <bill@segall.net>
Wed, 16 Dec 2015 01:17:36 +0000 (11:17 +1000)
Under the hood it's an unsigned rather than a signed type and whilst C
compilers are largely happy with this C++ compilers tend to be fussy
about class function signatures which makes C++ usage of libevent
problematic.

include/event2/util.h

index 3936786ec982e17b6261d02bc7c16cad4951be79..47391565be95687b335fd1c0673f11ee20754948 100644 (file)
@@ -300,9 +300,9 @@ extern "C" {
 
 /**
  * A type wide enough to hold the output of "socket()" or "accept()".  On
- * Windows, this is an intptr_t; elsewhere, it is an int. */
+ * Windows, this is an SOCKET; elsewhere, it is an int. */
 #ifdef _WIN32
-#define evutil_socket_t intptr_t
+#define evutil_socket_t SOCKET
 #else
 #define evutil_socket_t int
 #endif