Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32

This commit is contained in:
glx
2018-12-09 02:28:14 +01:00
committed by glx22
parent 8890926b0d
commit c540d72445
25 changed files with 74 additions and 74 deletions

View File

@@ -21,7 +21,7 @@
#ifdef ENABLE_NETWORK
/* Windows stuff */
#if defined(WIN32) || defined(WIN64)
#if defined(_WIN32)
#include <errno.h>
#include <winsock2.h>
#include <ws2tcpip.h>
@@ -125,7 +125,7 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai)
}
#define freeaddrinfo OTTDfreeaddrinfo
#endif /* __MINGW32__ && __CYGWIN__ */
#endif /* WIN32 */
#endif /* _WIN32 */
/* UNIX stuff */
#if defined(UNIX) && !defined(__OS2__)
@@ -290,7 +290,7 @@ typedef unsigned long in_addr_t;
*/
static inline bool SetNonBlocking(SOCKET d)
{
#ifdef WIN32
#ifdef _WIN32
u_long nonblocking = 1;
#else
int nonblocking = 1;