Skip to content

Commit d269f34

Browse files
Theunsnyalldawson
Theuns
authored andcommittedNov 5, 2017
Fix build using mingw
Changes many #if defined (Q_OS_WIN) to #ifdef _MSC_VER, where they relate specifically to msvc compiler
1 parent 394c531 commit d269f34

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed
 

‎src/app/mainwin.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
105105
}
106106
}
107107

108+
#ifdef _MSC_VER
108109
HINSTANCE hGetProcIDDLL = LoadLibrary( "qgis_app.dll" );
110+
#else
111+
// MinGW
112+
HINSTANCE hGetProcIDDLL = LoadLibrary( "libqgis_app.dll" );
113+
#endif
114+
109115
if ( !hGetProcIDDLL )
110116
{
111117
std::cerr << "Could not load the qgis_app.dll" << std::endl;

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12090,7 +12090,7 @@ void QgisApp::keyPressEvent( QKeyEvent *e )
1209012090
{
1209112091
stopRendering();
1209212092
}
12093-
#if defined(Q_OS_WIN) && defined(QGISDEBUG)
12093+
#if defined(_MSC_VER) && defined(QGISDEBUG)
1209412094
else if ( e->key() == Qt::Key_Backslash && e->modifiers() & Qt::ControlModifier )
1209512095
{
1209612096
QgsCrashHandler::handle( 0 );

‎src/app/qgscrashhandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "qgscrashreport.h"
2424
#include "qgsstacktrace.h"
2525

26-
#ifdef Q_OS_WIN
26+
#ifdef _MSC_VER
2727
LONG WINAPI QgsCrashHandler::handle( struct _EXCEPTION_POINTERS *ExceptionInfo )
2828
{
2929
QgsStackLines stack = QgsStackTrace::trace( ExceptionInfo );

‎src/app/qgscrashhandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class APP_EXPORT QgsCrashHandler
3232
{
3333

3434
public:
35-
#ifdef Q_OS_WIN
35+
#ifdef _MSC_VER
3636
static LONG WINAPI handle( struct _EXCEPTION_POINTERS *ExceptionInfo );
3737
#endif
3838

‎src/core/qgsapplication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ QString QgsApplication::userLoginName()
732732
if ( !sUserName.isEmpty() )
733733
return sUserName;
734734

735-
#ifdef Q_OS_WIN
735+
#ifdef _MSC_VER
736736
TCHAR name [ UNLEN + 1 ];
737737
DWORD size = UNLEN + 1;
738738

@@ -767,7 +767,7 @@ QString QgsApplication::userFullName()
767767
if ( !sUserFullName.isEmpty() )
768768
return sUserFullName;
769769

770-
#ifdef Q_OS_WIN
770+
#ifdef _MSC_VER
771771
TCHAR name [ UNLEN + 1 ];
772772
DWORD size = UNLEN + 1;
773773

‎src/core/qgsoptionalexpression.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ class CORE_EXPORT QgsOptionalExpression : public QgsOptional<QgsExpression>
7777
};
7878

7979

80-
#if defined(Q_OS_WIN)
80+
#if defined(_MSC_VER)
81+
#ifndef SIP_RUN
8182
template CORE_EXPORT QgsOptional<QgsExpression>;
8283
#endif
84+
#endif
8385

8486

8587
#endif // QGSOPTIONALEXPRESSION_H

‎src/core/qgsproject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
#include <QDir>
6161
#include <QUrl>
6262

63-
#ifdef Q_OS_UNIX
64-
#include <utime.h>
65-
#elif _MSC_VER
63+
#ifdef _MSC_VER
6664
#include <sys/utime.h>
65+
#else
66+
#include <utime.h>
6767
#endif
6868

6969
// canonical project instance

‎src/core/qgsstacktrace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
///@cond PRIVATE
3030

31-
#ifdef Q_OS_WIN
31+
#ifdef _MSC_VER
3232
QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *ExceptionInfo )
3333
{
3434
QgsStackLines stack;
@@ -145,7 +145,7 @@ void QgsStackTrace::setSymbolPath( QString symbolPaths )
145145
mSymbolPaths = symbolPaths;
146146
}
147147

148-
#endif // Q_OS_WIN
148+
#endif // _MSC_VER
149149

150150
#ifdef Q_OS_LINUX
151151
QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( unsigned int maxFrames )

‎src/core/qgsstacktrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CORE_EXPORT QgsStackTrace
6262
bool isValid() const;
6363
};
6464

65-
#ifdef Q_OS_WIN
65+
#ifdef _MSC_VER
6666

6767
/**
6868
* Return a demangled stack backtrace of the caller function.

0 commit comments

Comments
 (0)
Please sign in to comment.