Fix the build.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 03:32:02 +0000 (03:32 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 03:32:02 +0000 (03:32 +0000)
The C++ standard library interferes with Objective-C exceptions when built with -fno-exceptions.
Apply the workaround that we use in other projects to WebKitTestRunner.

* WebKitTestRunner/Configurations/Base.xcconfig: Use the prefix header for all targets.
* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Ditto.
* WebKitTestRunner/WebKitTestRunnerPrefix.h: Work around the C++ standard library obnoxiousness.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100553 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/Configurations/Base.xcconfig
Tools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig
Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h

index 05ee7d4..d28072b 100644 (file)
@@ -1,3 +1,14 @@
+2011-11-16  Mark Rowe  <mrowe@apple.com>
+
+        Fix the build.
+
+        The C++ standard library interferes with Objective-C exceptions when built with -fno-exceptions.
+        Apply the workaround that we use in other projects to WebKitTestRunner.
+
+        * WebKitTestRunner/Configurations/Base.xcconfig: Use the prefix header for all targets.
+        * WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Ditto.
+        * WebKitTestRunner/WebKitTestRunnerPrefix.h: Work around the C++ standard library obnoxiousness.
+
 2011-11-16  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
 
         [Qt] Fix build after WTR AX support
index 5d4d9dd..89a778c 100644 (file)
@@ -38,7 +38,7 @@ GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO
 WARNING_CFLAGS = -Wall -W -Wno-unused-parameter
 LINKER_DISPLAYS_MANGLED_NAMES = YES;
 VALID_ARCHS = i386 x86_64;
-
+GCC_PREFIX_HEADER = WebKitTestRunnerPrefix.h
 
 REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME));
 REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
index c46ac75..01e9413 100644 (file)
@@ -23,7 +23,6 @@
 
 PRODUCT_NAME = WebKitTestRunner
 GCC_ENABLE_OBJC_EXCEPTIONS = YES
-GCC_PREFIX_HEADER = WebKitTestRunnerPrefix.h
 
 INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Resources;
 SKIP_INSTALL = NO;
index f69fa3e..f34ec35 100644 (file)
 
 #include <wtf/Platform.h>
 #include <WebKit2/WebKit2.h>
+
+
+/* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
+* to allow C++ code that expects exceptions to build. These definitions
+* interfere with Objective-C++ uses of Objective-C exception handlers, which
+* use |@try| and |@catch|. As a workaround, undefine these macros. */
+
+#ifdef __cplusplus
+#include <algorithm> // needed for exception_defines.h
+#endif
+
+#ifdef __OBJC__
+#undef try
+#undef catch
+#endif
+