Index: src/app/main.cpp =================================================================== --- src/app/main.cpp (revision 11901) +++ src/app/main.cpp (working copy) @@ -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 @@ 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 Index: src/core/qgssearchstringparser.yy =================================================================== --- src/core/qgssearchstringparser.yy (revision 11901) +++ src/core/qgssearchstringparser.yy (working copy) @@ -20,6 +20,7 @@ %{ #include #include +#include #include "qgssearchtreenode.h" // don't redeclare malloc/free Index: src/core/pal/pal.h =================================================================== --- src/core/pal/pal.h (revision 11901) +++ src/core/pal/pal.h (working copy) @@ -39,11 +39,8 @@ #include #include +#include -#ifdef _MSC_VER -#include -#endif - // TODO ${MAJOR} ${MINOR} etc instead of 0.2 /**