disable exceptions - much smaller binary

This commit is contained in:
Glenn Maynard
2007-01-24 07:51:52 +00:00
parent 01df6164f2
commit 08a4dffbe1
3 changed files with 6 additions and 23 deletions
+3 -3
View File
@@ -51,7 +51,7 @@
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="1" ExceptionHandling="0"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
@@ -160,7 +160,7 @@
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,_CRT_SECURE_NO_DEPRECATE"
StringPooling="true" StringPooling="true"
MinimalRebuild="false" MinimalRebuild="false"
ExceptionHandling="1" ExceptionHandling="0"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
EnableFunctionLevelLinking="false" EnableFunctionLevelLinking="false"
@@ -263,7 +263,7 @@
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses" AdditionalIncludeDirectories=".;vorbis;libjpeg;"lua-5.1\include";ffmpeg\include;BaseClasses"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,WINDOWS,DEBUG,_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="1" ExceptionHandling="0"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="3" RuntimeLibrary="3"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
-20
View File
@@ -901,18 +901,7 @@ int main(int argc, char* argv[])
/* Set up arch hooks first. This may set up crash handling. */ /* Set up arch hooks first. This may set up crash handling. */
HOOKS = ArchHooks::Create(); HOOKS = ArchHooks::Create();
HOOKS->Init(); 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; LUA = new LuaManager;
/* Almost everything uses this to read and write files. Load this early. */ /* Almost everything uses this to read and write files. Load this early. */
@@ -1114,15 +1103,6 @@ int main(int argc, char* argv[])
ShutdownGame(); 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; return 0;
} }
@@ -20,6 +20,7 @@
#if _MSC_VER == 1400 // VC8 specific warnings #if _MSC_VER == 1400 // VC8 specific warnings
#pragma warning (disable : 4996) // deprecated functions vs "ISO C++ conformant names". (stricmp vs _stricmp) #pragma warning (disable : 4996) // deprecated functions vs "ISO C++ conformant names". (stricmp vs _stricmp)
#pragma warning (disable : 4005) // macro redefinitions (ARRAYSIZE) #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 <exception> when exceptions disabled
#endif #endif
#define snprintf _snprintf // Unsure if this goes with __MINGW32__ right now. #define snprintf _snprintf // Unsure if this goes with __MINGW32__ right now.
@@ -48,6 +49,8 @@
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#define _SCL_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: */ /* Don't include windows.h everywhere; when we do eventually include it, use these: */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN #define VC_EXTRALEAN