From c9e6c3d70f837755c3ea66700ff70f61d1e18015 Mon Sep 17 00:00:00 2001 From: billsegall Date: Wed, 16 Dec 2015 11:17:36 +1000 Subject: [PATCH] The Windows socket type is defined as SOCKET. 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/event2/util.h b/include/event2/util.h index 3936786e..47391565 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -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 -- 2.40.0