Fix #ifdef MSVC conditions leading to missing information in crash report

Fixes #50472
This commit is contained in:
Nyall Dawson 2022-10-19 09:08:20 +10:00
parent 7588ce429f
commit f0df4949d3
3 changed files with 7 additions and 7 deletions

View File

@ -116,7 +116,7 @@ void QgsCrashHandler::handleCrash( int processID, int threadID,
args << fileName;
QString prefixPath( getenv( "QGIS_PREFIX_PATH" ) ? getenv( "QGIS_PREFIX_PATH" ) : QApplication::applicationDirPath() );
#ifdef MSVC
#ifdef _MSC_VER
QString path = prefixPath + QStringLiteral( "/qgiscrashhandler.exe" );
#else
QString path = prefixPath + QStringLiteral( "/qgiscrashhandler" );

View File

@ -32,7 +32,7 @@
#include <sys/time.h>
#endif
#ifdef MSVC
#ifdef _MSC_VER
#include <Windows.h>
#include <ShlObj.h>
#pragma comment(lib,"Shell32.lib")
@ -280,7 +280,7 @@ QStringList QgsFileUtils::findFile( const QString &file, const QString &basePath
return foundFiles;
}
#ifdef MSVC
#ifdef _MSC_VER
std::unique_ptr< wchar_t[] > pathToWChar( const QString &path )
{
const QString nativePath = QDir::toNativeSeparators( path );
@ -294,7 +294,7 @@ std::unique_ptr< wchar_t[] > pathToWChar( const QString &path )
Qgis::DriveType QgsFileUtils::driveType( const QString &path )
{
#ifdef MSVC
#ifdef _MSC_VER
auto pathType = [ = ]( const QString & path ) -> DriveType
{
std::unique_ptr< wchar_t[] > pathArray = pathToWChar( path );

View File

@ -68,7 +68,7 @@ int main( int argc, char *argv[] )
versionInfo = info.split( "\n" );
}
#ifdef MSVC
#ifdef _MSC_VER
DWORD processId;
DWORD threadId;
LPEXCEPTION_POINTERS exception;
@ -86,7 +86,7 @@ int main( int argc, char *argv[] )
QgsCrashReport report;
report.setVersionInfo( versionInfo );
#ifdef MSVC
#ifdef _MSC_VER
report.setStackTrace( stackTrace.get() );
#endif
report.setPythonCrashLogFilePath( pythonCrashLogFile );
@ -101,7 +101,7 @@ int main( int argc, char *argv[] )
QApplication::exec();
#ifdef MSVC
#ifdef _MSC_VER
for ( HANDLE threadHandle : stackTrace->threads )
{
ResumeThread( threadHandle );