From aef7375ddbfc9def45ea3fc5b0c221ee455814c9 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Wed, 2 Sep 2009 07:59:17 +0000 Subject: [PATCH] * Add a new define WITH_EXCEPTIONS to allow exception handling to be forced on when in debug mode. * Add --enable-debug-exceptions to set WITH_EXCEPTIONS. * Fix precompiled header msg using AC_RESULT. (forgot this in the original patch) Originally committed to SVN as r3451. --- aegisub/configure.in | 16 ++++++++++++++++ aegisub/src/main.cpp | 5 ++--- aegisub/src/main.h | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) 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