Skip to content

Commit 2aeb920

Browse files
author
mhugent
committedDec 3, 2009
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

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
 

‎src/app/main.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@
4646
#ifdef MSVC
4747
#undef _fmode
4848
int _fmode = _O_BINARY;
49-
#endif
50-
#ifndef _MSC_VER
49+
#else
5150
// Only do this if we are not building on windows with msvc.
5251
// Recommended method for doing this with msvc is with a call to _set_fmode
5352
// which is the first thing we do in main().
54-
#undef _fmode
55-
int _fmode = _O_BINARY;
56-
#endif//_MSC_VER
53+
// Similarly, with MinGW set _fmode in main().
54+
#endif //_MSC_VER
5755
#else
5856
#include <getopt.h>
5957
#endif
@@ -238,9 +236,13 @@ void myMessageOutput( QtMsgType type, const char *msg )
238236

239237
int main( int argc, char *argv[] )
240238
{
239+
#ifdef WIN32 // Windows
241240
#ifdef _MSC_VER
242241
_set_fmode( _O_BINARY );
243-
#endif
242+
#else //MinGW
243+
_fmode = _O_BINARY;
244+
#endif // _MSC_VER
245+
#endif // WIN32
244246

245247
#ifndef _MSC_VER
246248
// Set up the custom qWarning/qDebug custom handler

‎src/core/pal/pal.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@
3737

3838
#include <list>
3939
#include <iostream>
40-
41-
#ifdef _MSC_VER
42-
#include <time.h>
43-
#endif
40+
#include <ctime>
4441

4542
// TODO ${MAJOR} ${MINOR} etc instead of 0.2
4643

‎src/core/qgssearchstringparser.yy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
%{
2121
#include <qglobal.h>
2222
#include <QList>
23+
#include <cstdlib>
2324
#include "qgssearchtreenode.h"
2425

2526
// don't redeclare malloc/free

0 commit comments

Comments
 (0)
Please sign in to comment.