diff --git a/aegisub/configure.in b/aegisub/configure.in index f79ff09df..08b59efb9 100644 --- a/aegisub/configure.in +++ b/aegisub/configure.in @@ -864,6 +864,11 @@ fi AC_MSG_CHECKING([whether to use precompiled headers]) AC_ARG_ENABLE(gcc-prec, [ --enable-gcc-prec enable GCC precompiled headers (default=no)]) +if test "$enable_gcc_prec" = "yes"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi AM_CONDITIONAL([PRECOMPILED_HEADER], [test "$enable_gcc_prec" = "yes"]) @@ -903,6 +908,17 @@ fi AC_SUBST(PACKAGE_DEBUG) +AC_MSG_CHECKING([whether to use exception handling in debug mode]) +AC_ARG_ENABLE(debug-exceptions, [ --enable-debug-exceptions + enable exception handling in debug mode (default=no)]) +if test "$enable_debug_exceptions" = "yes"; then + AC_DEFINE(WITH_EXCEPTIONS, 1, [Enable exception handling in debug mode. (--enable-debug) This is always enabled when debug mode is off.]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + + ########### # Profiling ########### diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index 3bd0c158a..5608f4beb 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -161,7 +161,7 @@ bool AegisubApp::OnInit() { #endif // Crash handling -#ifndef _DEBUG +#if !defined(_DEBUG) || defined(WITH_EXCEPTIONS) StartupLog(_T("Install exception handler")); wxHandleFatalExceptions(true); #endif @@ -278,8 +278,7 @@ int AegisubApp::OnExit() { } -#ifndef _DEBUG - +#if !defined(_DEBUG) || defined(WITH_EXCEPTIONS) /// DOCME const static wxChar unhandled_exception_message[] = _T("Oops, Aegisub has crashed!\n\nI have tried to emergency-save a copy of your file, and a crash log file has been generated.\n\nYou can find the emergency-saved file in:\n%s\n\nIf you submit the crash log to the Aegisub team, we will investigate the problem and attempt to fix it. You can find the crashlog in:\n%s\n\nAegisub will now close."); diff --git a/aegisub/src/main.h b/aegisub/src/main.h index d345a2abc..f724d56b3 100644 --- a/aegisub/src/main.h +++ b/aegisub/src/main.h @@ -107,7 +107,7 @@ public: virtual void MacOpenFile(const wxString &filename); #endif -#ifndef _DEBUG +#if !defined(_DEBUG) || defined(WITH_EXCEPTIONS) void OnUnhandledException(); void OnFatalException(); #endif