From 242f2b48856de6ea0ab2194b3cb7eabf04f36220 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Thu, 28 Oct 2004 01:03:57 +0000 Subject: [PATCH] Fixed 2 occourances of -1 insted of 0 causing a small issue. --- stepmania/src/ezsockets.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ezsockets.cpp b/stepmania/src/ezsockets.cpp index 7c985ca2cb..075376a51e 100644 --- a/stepmania/src/ezsockets.cpp +++ b/stepmania/src/ezsockets.cpp @@ -23,6 +23,11 @@ #define SOCKET_ERROR -1 #endif +//There are cases where 0 isn't a proper socket +#if !defined(SOCKET_NONE) +#define SOCKET_NONE 0 +#endif + #if !defined(INVALID_SOCKET) #define INVALID_SOCKET -1 #endif @@ -55,7 +60,7 @@ EzSockets::~EzSockets() //Check to see if the socket has been created bool EzSockets::check() { - return sock != INVALID_SOCKET; + return sock > SOCKET_NONE; } bool EzSockets::create() @@ -89,7 +94,7 @@ bool EzSockets::create(int Protocol, int Type) state = skDISCONNECTED; sock = socket(AF_INET, Type, Protocol); lastCode = sock; - return sock != INVALID_SOCKET; + return sock > SOCKET_NONE; //Socket must be Greater than 0 } @@ -142,7 +147,7 @@ bool EzSockets::accept(EzSockets& socket) lastCode = socket.sock; - if (socket.sock == INVALID_SOCKET) + if ( socket.sock == SOCKET_ERROR ) return false; socket.state = skCONNECTED;