From 1df9bec5638f0ce4c828d9a276a34335e618d769 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 17 Jun 2014 21:56:53 +0200 Subject: [PATCH] Fix compilation of NLNET under MinGW --- code/nel/src/ligo/stdligo.h | 4 +++- code/nel/src/ligo/zone_bank.cpp | 2 ++ code/nel/src/net/buf_client.cpp | 4 +++- code/nel/src/net/buf_server.cpp | 4 +++- code/nel/src/net/buf_sock.cpp | 4 +++- code/nel/src/net/listen_sock.cpp | 4 +++- code/nel/src/net/service.cpp | 6 ++++-- code/nel/src/net/sock.cpp | 4 +++- code/nel/src/net/stdnet.h | 4 +++- code/nel/src/net/tcp_sock.cpp | 4 +++- code/nel/src/net/udp_sock.cpp | 4 +++- 11 files changed, 33 insertions(+), 11 deletions(-) diff --git a/code/nel/src/ligo/stdligo.h b/code/nel/src/ligo/stdligo.h index 3c86f25e6..c8f4e2a9a 100644 --- a/code/nel/src/ligo/stdligo.h +++ b/code/nel/src/ligo/stdligo.h @@ -63,6 +63,8 @@ #include "nel/misc/file.h" #ifdef NL_OS_WINDOWS - #define NOMINMAX + #ifndef NL_COMP_MINGW + #define NOMINMAX + #endif #include #endif diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index ff24821af..a099168f8 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -25,7 +25,9 @@ #include "nel/misc/o_xml.h" #ifdef NL_OS_WINDOWS +#ifndef NL_COMP_MINGW #define NOMINMAX +#endif #include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 939dbc89a..350b2d6db 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -24,7 +24,9 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/buf_server.cpp b/code/nel/src/net/buf_server.cpp index 44c966e11..09b061fd4 100644 --- a/code/nel/src/net/buf_server.cpp +++ b/code/nel/src/net/buf_server.cpp @@ -22,7 +22,9 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/buf_sock.cpp b/code/nel/src/net/buf_sock.cpp index e7f07085d..8535435b0 100644 --- a/code/nel/src/net/buf_sock.cpp +++ b/code/nel/src/net/buf_sock.cpp @@ -25,7 +25,9 @@ #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/listen_sock.cpp b/code/nel/src/net/listen_sock.cpp index 8c9802076..7dedd6b97 100644 --- a/code/nel/src/net/listen_sock.cpp +++ b/code/nel/src/net/listen_sock.cpp @@ -22,7 +22,9 @@ #ifdef NL_OS_WINDOWS -#define NOMINMAX +#ifndef NL_COMP_MINGW +# define NOMINMAX +#endif #include typedef sint socklen_t; diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 3a6991485..f42806245 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -24,8 +24,10 @@ // these defines is for IsDebuggerPresent(). it'll not compile on windows 95 // just comment this and the IsDebuggerPresent to compile on windows 95 # define _WIN32_WINDOWS 0x0410 -# define WINVER 0x0400 -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define WINVER 0x0400 +# define NOMINMAX +# endif # include # include #elif defined NL_OS_UNIX diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 2a88ca967..0e2329733 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -22,7 +22,9 @@ #include "nel/misc/hierarchical_timer.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include # define socklen_t int diff --git a/code/nel/src/net/stdnet.h b/code/nel/src/net/stdnet.h index 3a67ea783..d18db3222 100644 --- a/code/nel/src/net/stdnet.h +++ b/code/nel/src/net/stdnet.h @@ -17,7 +17,9 @@ #include "nel/misc/types_nl.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/net/tcp_sock.cpp b/code/nel/src/net/tcp_sock.cpp index 12948e033..ed04b21b4 100644 --- a/code/nel/src/net/tcp_sock.cpp +++ b/code/nel/src/net/tcp_sock.cpp @@ -21,7 +21,9 @@ #ifdef NL_OS_WINDOWS # include -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # define socklen_t int # define ERROR_NUM WSAGetLastError() diff --git a/code/nel/src/net/udp_sock.cpp b/code/nel/src/net/udp_sock.cpp index a7dcd4483..16b75d929 100644 --- a/code/nel/src/net/udp_sock.cpp +++ b/code/nel/src/net/udp_sock.cpp @@ -21,7 +21,9 @@ #ifdef NL_OS_WINDOWS # include -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # define socklen_t int # define ERROR_NUM WSAGetLastError()