1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-05 20:55:47 +03:00

Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET

INVALID_SOCKET is a special value in Windows representing a
non-valid socket identifier. We were #defining this to -1 on
non-Windows platforms, causing unneccessary namespace pollution.
Let's have our own identifier instead.

Thanks to Matt Lawson for pointing this out.
This commit is contained in:
Peter Stuge
2012-03-02 17:33:42 +01:00
parent 179d2197dd
commit f28264c6a3
3 changed files with 6 additions and 5 deletions

View File

@@ -135,9 +135,10 @@ typedef long long libssh2_int64_t;
#ifdef WIN32
typedef SOCKET libssh2_socket_t;
#define LIBSSH2_INVALID_SOCKET INVALID_SOCKET
#else /* !WIN32 */
typedef int libssh2_socket_t;
#define INVALID_SOCKET -1
#define LIBSSH2_INVALID_SOCKET -1
#endif /* WIN32 */
/* Part of every banner, user specified or not */