diff --git a/src/core/mac_delegate.h b/src/core/mac_delegate.h index fefe18d16..998923511 100644 --- a/src/core/mac_delegate.h +++ b/src/core/mac_delegate.h @@ -1,9 +1,12 @@ #import -#import - #include "config.h" +#ifdef HAVE_BREAKPAD +#import +#endif + + class PlatformInterface; #ifdef SNOW_LEOPARD @@ -14,7 +17,9 @@ class PlatformInterface; PlatformInterface* application_handler_; NSMenu* dock_menu_; +#ifdef HAVE_BREAKPAD BreakpadRef breakpad_; +#endif } - (id) initWithHandler: (PlatformInterface*)handler; diff --git a/src/core/mac_startup.mm b/src/core/mac_startup.mm index 9bf520a36..016e9de33 100644 --- a/src/core/mac_startup.mm +++ b/src/core/mac_startup.mm @@ -68,6 +68,7 @@ - (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat; @end +#ifdef HAVE_BREAKPAD static bool BreakpadCallback(int, int, mach_port_t, void*) { return true; } @@ -83,6 +84,7 @@ static BreakpadRef InitBreakpad() { [pool release]; return breakpad; } +#endif // HAVE_BREAKPAD @implementation AppDelegate @@ -96,7 +98,11 @@ static BreakpadRef InitBreakpad() { - (id) initWithHandler: (PlatformInterface*)handler { application_handler_ = handler; + +#ifdef HAVE_BREAKPAD breakpad_ = InitBreakpad(); +#endif + return self; } @@ -126,7 +132,9 @@ static BreakpadRef InitBreakpad() { } - (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*) sender { +#ifdef HAVE_BREAKPAD BreakpadRelease(breakpad_); +#endif return NSTerminateNow; } @end