From 08a4dffbe118e0dbc0e571181e34db7a53615833 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 24 Jan 2007 07:51:52 +0000 Subject: [PATCH] disable exceptions - much smaller binary --- stepmania/src/StepMania-net2005.vcproj | 6 +++--- stepmania/src/StepMania.cpp | 20 -------------------- stepmania/src/archutils/Win32/arch_setup.h | 3 +++ 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/stepmania/src/StepMania-net2005.vcproj b/stepmania/src/StepMania-net2005.vcproj index f285a2a7db..a208837ff7 100644 --- a/stepmania/src/StepMania-net2005.vcproj +++ b/stepmania/src/StepMania-net2005.vcproj @@ -51,7 +51,7 @@ Optimization="0" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE" - ExceptionHandling="1" + ExceptionHandling="0" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" @@ -160,7 +160,7 @@ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,_CRT_SECURE_NO_DEPRECATE" StringPooling="true" MinimalRebuild="false" - ExceptionHandling="1" + ExceptionHandling="0" RuntimeLibrary="2" BufferSecurityCheck="false" EnableFunctionLevelLinking="false" @@ -263,7 +263,7 @@ Optimization="0" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE" - ExceptionHandling="1" + ExceptionHandling="0" BasicRuntimeChecks="0" RuntimeLibrary="3" UsePrecompiledHeader="2" diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index fc81328ad1..add8760772 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -901,18 +901,7 @@ int main(int argc, char* argv[]) /* Set up arch hooks first. This may set up crash handling. */ HOOKS = ArchHooks::Create(); HOOKS->Init(); -#if !defined(DEBUG) - /* Tricky: for other exceptions, we want a backtrace. To do this in Windows, - * we need to catch the exception and force a crash. The call stack is still - * there, and gets picked up by the crash handler. (If we don't catch it, we'll - * get a generic, useless "abnormal termination" dialog.) In Linux, if we do this - * we'll only get main() on the stack, but if we don't catch the exception, it'll - * just work. So, only catch generic exceptions in Windows. */ -#if defined(_WINDOWS) - try { /* exception */ -#endif -#endif LUA = new LuaManager; /* Almost everything uses this to read and write files. Load this early. */ @@ -1113,15 +1102,6 @@ int main(int argc, char* argv[]) PREFSMAN->SavePrefsToDisk(); ShutdownGame(); - -#if !defined(DEBUG) && defined(_WINDOWS) - } - catch( const exception &e ) - { - /* This can be things like calling std::string::reserve(-1), or out of memory. */ - FAIL_M( e.what() ); - } -#endif return 0; } diff --git a/stepmania/src/archutils/Win32/arch_setup.h b/stepmania/src/archutils/Win32/arch_setup.h index 1edc17a50c..7e261dc5a6 100644 --- a/stepmania/src/archutils/Win32/arch_setup.h +++ b/stepmania/src/archutils/Win32/arch_setup.h @@ -20,6 +20,7 @@ #if _MSC_VER == 1400 // VC8 specific warnings #pragma warning (disable : 4996) // deprecated functions vs "ISO C++ conformant names". (stricmp vs _stricmp) #pragma warning (disable : 4005) // macro redefinitions (ARRAYSIZE) +#pragma warning (disable : 4275) // non dll-interface class 'stdext::exception' used as base for dll-interface class 'std::bad_cast', bug in VC when exceptions disabled #endif #define snprintf _snprintf // Unsure if this goes with __MINGW32__ right now. @@ -48,6 +49,8 @@ #define _CRT_SECURE_NO_DEPRECATE #define _SCL_SECURE_NO_DEPRECATE +#define _HAS_EXCEPTIONS 0 + /* Don't include windows.h everywhere; when we do eventually include it, use these: */ #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN