mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-20 22:20:42 +00:00
93be5aca05
- Worked aorund modern GCC bug where C++ exceptions in Objective-C++ code would result in an ICE (bug is already on their tracker, but I doubt it will be fixed unless I decide to dig into the issue myself). - Turn off fused floating point instructions since these can cause slight deviations in floating point code. - Use -static-libgcc when compiling on the Mac with GCC since we need to use a custom version of GCC to do so now. - Note: ZDoom will currently still crash on exit on PowerPC since it seems to be deciding that NameManager needs to be destructed before the console commands.
34 lines
598 B
C++
34 lines
598 B
C++
// Workaround for GCC Objective-C++ with C++ exceptions bug.
|
|
|
|
#include "doomerrors.h"
|
|
#include <stdlib.h>
|
|
|
|
// Import some functions from i_main.mm
|
|
void call_terms();
|
|
void Mac_I_FatalError(const char* const message);
|
|
void OriginalMainTry(int argc, char** argv);
|
|
|
|
void OriginalMainExcept(int argc, char** argv)
|
|
{
|
|
try
|
|
{
|
|
OriginalMainTry(argc, argv);
|
|
}
|
|
catch(const CDoomError& error)
|
|
{
|
|
const char* const message = error.GetMessage();
|
|
|
|
if (NULL != message)
|
|
{
|
|
fprintf(stderr, "%s\n", message);
|
|
Mac_I_FatalError(message);
|
|
}
|
|
|
|
exit(-1);
|
|
}
|
|
catch(...)
|
|
{
|
|
call_terms();
|
|
throw;
|
|
}
|
|
}
|