From fabf42c8074920c11408567fe99891f7d4ce8ecf Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 2 Jan 2011 10:29:13 +0000 Subject: [PATCH] - bugfixes for mingw compilers --- CMakeLists.txt | 6 +++++- source/glest_game/main/main.cpp | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbb587e2..826fa576 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) # Default compiler flags #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") ## Strip binary - ADD_DEFINITIONS("-fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic") + IF(NOT MINGW) + ADD_DEFINITIONS("-fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic") + ELSE() + ADD_DEFINITIONS("-fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse") + ENDIF() #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # Debug compiler flags diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 4ee82403..473ce5f3 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -37,7 +37,7 @@ #include "cache_manager.h" // For gcc backtrace on crash! -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) #include #include #include @@ -259,7 +259,7 @@ public: string errMsg = (msg != NULL ? msg : "null"); - #ifdef __GNUC__ + #if defined(__GNUC__) && !defined(__MINGW32__) errMsg += "\nStack Trace:\n"; //errMsg += "To find line #'s use:\n"; //errMsg += "readelf --debug-dump=decodedline %s | egrep 0xaddress-of-stack\n"; @@ -1463,7 +1463,7 @@ __try { #endif application_binary=argv[0]; -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__MINGW32__) signal(SIGSEGV, handleSIGSEGV); #endif