diff options
author | darkvater <darkvater@openttd.org> | 2004-12-23 22:31:46 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-12-23 22:31:46 +0000 |
commit | b2499545385caeb4d9ccc8b8d1c8737441ae5ae9 (patch) | |
tree | 0c36d0f7aed9d6abbdcb4025305824270c0169da /network_core.h | |
parent | dda14faac5242af4940dd012f32f9cfbea0738f2 (diff) | |
download | openttd-b2499545385caeb4d9ccc8b8d1c8737441ae5ae9.tar.xz |
(svn r1266) -Fix: fix some cygwin/mingw warnings
-Note: when compiling with MinGW (-mno-cygwin) __MINGW32__ is defined; when compiling without it __CYGWIN32__ is defined. You need to set either -mno-cygwin (MinGW) or -mwin32 (Cygwin) to have WIN32 defined
Diffstat (limited to 'network_core.h')
-rw-r--r-- | network_core.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/network_core.h b/network_core.h index d6a408c33..bf29116ec 100644 --- a/network_core.h +++ b/network_core.h @@ -9,19 +9,23 @@ // Windows stuff #if defined(WIN32) -# include <windows.h> -# include <winsock2.h> -# include <ws2tcpip.h> +#include <windows.h> +#include <winsock2.h> +#include <ws2tcpip.h> #ifdef _MSC_VER -#pragma comment (lib, "ws2_32.lib") + #pragma comment (lib, "ws2_32.lib") #endif //_MSC_VER -# define ENABLE_NETWORK // On windows, the network is always enabled -# define GET_LAST_ERROR() WSAGetLastError() -# define EWOULDBLOCK WSAEWOULDBLOCK +#if ! (defined(__MINGW32__) || defined(__CYGWIN__)) + #define ENABLE_NETWORK // On windows, the network is always enabled + // Windows has some different names for some types.. + typedef SSIZE_T ssize_t; +#endif + +#define GET_LAST_ERROR() WSAGetLastError() +#define EWOULDBLOCK WSAEWOULDBLOCK // Windows has some different names for some types.. -typedef SSIZE_T ssize_t; typedef unsigned long in_addr_t; typedef INTERFACE_INFO IFREQ; #endif // WIN32 |