From d808b4ecc40b521117c0562fb4aa5f95130fda8c Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 1 Feb 2013 05:52:00 +0000 Subject: [PATCH] - added Unit selection type label - updated unhandled exception logic in linux --- mk/cmake/Modules/FindGoogleBreakpad.cmake | 2 ++ source/glest_game/main/main.cpp | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/mk/cmake/Modules/FindGoogleBreakpad.cmake b/mk/cmake/Modules/FindGoogleBreakpad.cmake index e5a395f3..580d56d3 100644 --- a/mk/cmake/Modules/FindGoogleBreakpad.cmake +++ b/mk/cmake/Modules/FindGoogleBreakpad.cmake @@ -12,6 +12,8 @@ SET(BREAKPAD_OS "linux") IF(WIN32) SET(BREAKPAD_OS "windows") +ELSEIF(APPLE) + SET(BREAKPAD_OS "mac") ENDIF() FIND_PATH(BREAKPAD_INCLUDE_DIR diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 809540f6..8eadfc13 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -284,7 +284,9 @@ void fatal(const char *s, ...) // failure exit LPWSTR wstr = Ansi2WideString(errText.c_str()); LPWSTR wstr1 = Ansi2WideString(sErr.c_str()); - MessageBox(NULL, wstr, wstr1, MB_OK|MB_SYSTEMMODAL); + if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) { + MessageBox(NULL, wstr, wstr1, MB_OK|MB_SYSTEMMODAL); + } delete [] wstr; delete [] wstr1; @@ -5189,10 +5191,12 @@ static bool MinidumpCallback(const wchar_t *dump_path, bool succeeded) { printf("\n======= In MinidumpCallback...\n"); wprintf(L"\n***ERROR details captured:\nCrash minidump folder: %s\nfile: %s.dmp\nSucceeded: %d\n", (dump_path != NULL ? dump_path : L"(null)"),(minidump_id != NULL ? minidump_id : L"(null)"),succeeded); - - wchar_t szBuf[8096]; - _snwprintf(szBuf,8096,L"An unhandled error was detected.\n\nA crash dump file has been created in the folder:\n%s\nCrash dump filename is: %s.dmp",dump_path,minidump_id); - MessageBox(NULL, szBuf, L"Unhandled error", MB_OK|MB_SYSTEMMODAL); + + if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) { + wchar_t szBuf[8096]; + _snwprintf(szBuf,8096,L"An unhandled error was detected.\n\nA crash dump file has been created in the folder:\n%s\nCrash dump filename is: %s.dmp",dump_path,minidump_id); + MessageBox(NULL, szBuf, L"Unhandled error", MB_OK|MB_SYSTEMMODAL); + } return succeeded; } @@ -5206,9 +5210,12 @@ static bool MinidumpCallback(const google_breakpad::MinidumpDescriptor& descript printf("\n======= In MinidumpCallback...\n"); printf("\n***ERROR details captured:\nCrash minidump folder: %s\nfile: %s\nSucceeded: %d\n", descriptor.directory().c_str(),descriptor.path(),succeeded); - char szBuf[8096]; - snprintf(szBuf,8096,"An unhandled error was detected.\n\nA crash dump file has been created in the folder:\n%s\nCrash dump filename is: %s.dmp",descriptor.directory().c_str(),descriptor.path()); - //MessageBox(NULL, szBuf, "Unhandled error", MB_OK|MB_SYSTEMMODAL); + if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) { + char szBuf[8096]; + snprintf(szBuf,8096,"An unhandled error was detected.\n\nA crash dump file has been created in the folder:\n%s\nCrash dump filename is: %s.dmp",descriptor.directory().c_str(),descriptor.path()); + //MessageBox(NULL, szBuf, "Unhandled error", MB_OK|MB_SYSTEMMODAL); + message(szBuf); + } return succeeded; }