diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-10 12:13:03 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-17 15:46:25 +0200 |
commit | 43f510d37d680ca4347878d2fb6f8b97b54e7611 (patch) | |
tree | 137cb51c1953826cd595584e8371d5fbd4b2ccb3 /src/compat.h | |
parent | c4f11ca9c32a90c57bd26eb38e5a264a95baba41 (diff) |
Convert closesocket 'compat wrapper' to function in netbase
Simpler alternative to #4348.
The current setup with closesocket() is strange. It poses
as a compatibility wrapper but adds functionality.
Rename it and make it a documented utility function in netbase.
Code movement only, zero effect on the functionality.
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/compat.h b/src/compat.h index 8fbafb6cce..1b3a60d11b 100644 --- a/src/compat.h +++ b/src/compat.h @@ -59,19 +59,4 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif -inline int myclosesocket(SOCKET& hSocket) -{ - if (hSocket == INVALID_SOCKET) - return WSAENOTSOCK; -#ifdef WIN32 - int ret = closesocket(hSocket); -#else - int ret = close(hSocket); -#endif - hSocket = INVALID_SOCKET; - return ret; -} -#define closesocket(s) myclosesocket(s) - - #endif |