From 2aeb92081cd0f0a5e5094e9648ce7c82ed68a648 Mon Sep 17 00:00:00 2001 From: mhugent Date: Thu, 3 Dec 2009 14:55:48 +0000 Subject: [PATCH] Apply patch #2156, fixes for Windows - MinGW gcc 4.4.0 compiler git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12325 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/app/main.cpp | 14 ++++++++------ src/core/pal/pal.h | 5 +---- src/core/qgssearchstringparser.yy | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index e96d770ecbf9..ed7fc2612d32 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -46,14 +46,12 @@ #ifdef MSVC #undef _fmode int _fmode = _O_BINARY; -#endif -#ifndef _MSC_VER +#else // Only do this if we are not building on windows with msvc. // Recommended method for doing this with msvc is with a call to _set_fmode // which is the first thing we do in main(). -#undef _fmode -int _fmode = _O_BINARY; -#endif//_MSC_VER +// Similarly, with MinGW set _fmode in main(). +#endif //_MSC_VER #else #include #endif @@ -238,9 +236,13 @@ void myMessageOutput( QtMsgType type, const char *msg ) int main( int argc, char *argv[] ) { +#ifdef WIN32 // Windows #ifdef _MSC_VER _set_fmode( _O_BINARY ); -#endif +#else //MinGW + _fmode = _O_BINARY; +#endif // _MSC_VER +#endif // WIN32 #ifndef _MSC_VER // Set up the custom qWarning/qDebug custom handler diff --git a/src/core/pal/pal.h b/src/core/pal/pal.h index 7bea9f9f43ef..8523b54bb61d 100644 --- a/src/core/pal/pal.h +++ b/src/core/pal/pal.h @@ -37,10 +37,7 @@ #include #include - -#ifdef _MSC_VER -#include -#endif +#include // TODO ${MAJOR} ${MINOR} etc instead of 0.2 diff --git a/src/core/qgssearchstringparser.yy b/src/core/qgssearchstringparser.yy index 7930ab27d355..852684efa8af 100644 --- a/src/core/qgssearchstringparser.yy +++ b/src/core/qgssearchstringparser.yy @@ -20,6 +20,7 @@ %{ #include #include +#include #include "qgssearchtreenode.h" // don't redeclare malloc/free