diff --git a/src/include/freecraft.h b/src/include/freecraft.h index 0abd6f3e1..916f73f4f 100644 --- a/src/include/freecraft.h +++ b/src/include/freecraft.h @@ -104,7 +104,7 @@ #endif -#if defined(WIN32) && defined(DEBUG) +#if defined(__MINGW32__) && defined(DEBUG) // GDB + MINGW doesn't like free(0) #include <stdlib.h> #define free(x) do { void* __x; __x=(x); if( __x ) free( __x ); } while(0) diff --git a/src/include/net_lowlevel.h b/src/include/net_lowlevel.h index f20eaf480..eda1c3297 100644 --- a/src/include/net_lowlevel.h +++ b/src/include/net_lowlevel.h @@ -51,12 +51,21 @@ #define _WIN32_WINNT 0x0400 #define WINVER 0x0400 #endif + +#ifdef __MINGW32__ +#define DrawIcon WinDrawIcon +#endif + #include <winsock2.h> #include <windows.h> #include <winsock.h> //#include <ws2tcpip.h> +#ifdef __MINGW32__ +#undef DrawIcon +#endif + // MS Knowledge base fix for SIO_GET_INTERFACE_LIST with NT4.0 ++ #define SIO_GET_INTERFACE_LIST 0x4004747F #define IFF_UP 1 diff --git a/src/sound/ogg.cpp b/src/sound/ogg.cpp index 34676331c..ea2fff6d2 100644 --- a/src/sound/ogg.cpp +++ b/src/sound/ogg.cpp @@ -39,7 +39,7 @@ #include <inttypes.h> #else #if defined(_MSC_VER) && !defined(_WIN32_WCE) -#include "windows.h" +#include <windows.h> #endif #include <stdint.h> #endif // BSD diff --git a/src/video/sdl.cpp b/src/video/sdl.cpp index 201569eec..3e934b94d 100644 --- a/src/video/sdl.cpp +++ b/src/video/sdl.cpp @@ -50,7 +50,7 @@ #endif #ifdef USE_WIN32 -#include <winsock.h> +#include "net_lowlevel.h" #endif #include "video.h"