From d4df92aedcae7a152926b06de2f661085b47bb0f Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Tue, 11 Dec 2012 13:46:41 +0000 Subject: Allow the Mac and iOS Breakpad clients to build without exceptions when the C++ standard library is not provided by libstdc++. libc++, for example, does not provide its own try and catch replacement macros when exceptions are disabled. BUG=509 Review URL: https://breakpad.appspot.com/503002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1089 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/mac/Framework/Breakpad.mm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/client/mac/Framework') diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm index 2817f380..4762516e 100644 --- a/src/client/mac/Framework/Breakpad.mm +++ b/src/client/mac/Framework/Breakpad.mm @@ -42,8 +42,9 @@ #import "client/mac/Framework/Breakpad.h" #import -#import -#import +#include +#include +#include #import "client/mac/crash_generation/Inspector.h" #import "client/mac/handler/exception_handler.h" @@ -53,6 +54,18 @@ #import "common/mac/MachIPC.h" #import "common/mac/SimpleStringDictionary.h" +#ifndef __EXCEPTIONS +// This file uses C++ try/catch (but shouldn't). Duplicate the macros from +// allowing this file to work properly with +// exceptions disabled even when other C++ libraries are used. #undef the try +// and catch macros first in case libstdc++ is in use and has already provided +// its own definitions. +#undef try +#define try if (true) +#undef catch +#define catch(X) if (false) +#endif // __EXCEPTIONS + using google_breakpad::KeyValueEntry; using google_breakpad::MachPortSender; using google_breakpad::MachReceiveMessage; -- cgit v1.2.1