From: Mikko Rasa Date: Sat, 11 Oct 2014 09:45:15 +0000 (+0300) Subject: Compatibility changes for building on OS X 10.5 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6ede8137c8247f1f7d82ed7dcaad50d3f4baae0c;p=libs%2Fgui.git Compatibility changes for building on OS X 10.5 --- diff --git a/source/graphics/cocoa/cocoadisplay.m b/source/graphics/cocoa/cocoadisplay.m index 9c7711e..c6485a7 100644 --- a/source/graphics/cocoa/cocoadisplay.m +++ b/source/graphics/cocoa/cocoadisplay.m @@ -1,4 +1,7 @@ +#include +#include #import +#import #import #import #include "cocoadisplay.h" @@ -20,9 +23,11 @@ CocoaDisplay *create_display() CocoaDisplay *display = (CocoaDisplay *)malloc(sizeof(CocoaDisplay)); display->arp = [[NSAutoreleasePool alloc] init]; display->app = [NSApplication sharedApplication]; +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 // This makes windows appear when run from terminal if([display->app respondsToSelector:@selector(setActivationPolicy:)]) [display->app setActivationPolicy:NSApplicationActivationPolicyRegular]; +#endif [display->app finishLaunching]; CFArrayCallBacks callbacks; diff --git a/source/graphics/cocoa/cocoawindow.m b/source/graphics/cocoa/cocoawindow.m index 5b63e8c..745488b 100644 --- a/source/graphics/cocoa/cocoawindow.m +++ b/source/graphics/cocoa/cocoawindow.m @@ -1,9 +1,16 @@ +#import #import #import #include "cocoadisplay.h" #include "cocoawindow.h" -@interface WindowDelegate: NSObject +#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +@protocol NSWindowDelegate @end +#endif + +@interface WindowDelegate: NSObject { + int dummy_member; +} - (BOOL)windowShouldClose:(id)sender; diff --git a/source/graphics/quartz/quartzloader.cpp b/source/graphics/quartz/quartzloader.cpp index 1fc93ad..d1baaef 100644 --- a/source/graphics/quartz/quartzloader.cpp +++ b/source/graphics/quartz/quartzloader.cpp @@ -1,7 +1,5 @@ #include -#include -#include -#include +#include // Avoid messing up sigc++ headers #undef nil #include "quartzloader.h"