mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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.
This commit is contained in:
parent
1c17cfdd2b
commit
c9e6c3d70f
@ -300,9 +300,9 @@ extern "C" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A type wide enough to hold the output of "socket()" or "accept()". On
|
* 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
|
#ifdef _WIN32
|
||||||
#define evutil_socket_t intptr_t
|
#define evutil_socket_t SOCKET
|
||||||
#else
|
#else
|
||||||
#define evutil_socket_t int
|
#define evutil_socket_t int
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user