From 164e781dbcdf9ffb762ea3899ee44f82ab842cdc Mon Sep 17 00:00:00 2001 From: "ramiro%netscape.com" Date: Mon, 1 Mar 1999 12:54:16 +0000 Subject: [PATCH] Do the exception thing only if HAVE_CPP_EXCEPTIONS is defined. git-svn-id: svn://10.0.0.236/trunk@22438 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/tests/TestCOMPtr.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/tests/TestCOMPtr.cpp b/mozilla/xpcom/tests/TestCOMPtr.cpp index 4f6bb6c6b5d..4d6b909ff45 100644 --- a/mozilla/xpcom/tests/TestCOMPtr.cpp +++ b/mozilla/xpcom/tests/TestCOMPtr.cpp @@ -21,8 +21,6 @@ #include "nsCOMPtr.h" #include "nsISupports.h" - - #ifndef NSCAP_NO_NEW_CASTS #define STATIC_CAST(T,x) static_cast(x) #define REINTERPRET_CAST(T,x) reinterpret_cast(x) @@ -290,7 +288,17 @@ AVoidPtrPtrContext( void** ) } +// Optimism +#define TEST_EXCEPTIONS 1 +// HAVE_CPP_EXCEPTIONS is defined automagically on unix +#if defined(XP_UNIX) +#if !defined(HAVE_CPP_EXCEPTIONS) +#undef TEST_EXCEPTIONS +#endif +#endif + +#ifdef TEST_EXCEPTIONS static nsresult TestBloat_Raw() @@ -329,8 +337,7 @@ TestBloat_Raw() return result; } - - +#endif // TEST_EXCEPTIONS static nsresult @@ -382,7 +389,9 @@ main() cout << "sizeof(nsCOMPtr) --> " << sizeof(nsCOMPtr) << endl; +#ifdef TEST_EXCEPTIONS TestBloat_Raw(); +#endif // TEST_EXCEPTIONS TestBloat_Raw_Unsafe(); TestBloat_Smart();