Fixed the Mac OS X 10.6 building using a rather hackish approach... Now it won't build on 10.6 itself without problems, so...
This commit is contained in:
parent
5f5f4f6c2a
commit
3e9e767d79
|
@ -5,7 +5,29 @@
|
|||
#include <Foundation/NSObject.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
|
||||
// see the hack below; we'll include everything first just in case some other headers get included below; if the hack ever gets resolved, we can use the ones below instead
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
|
||||
// HACK.
|
||||
// Apple's header files are bugged: there's an enum that was introduced in 10.7 with new values added in 10.8, but instead of wrapping the whole enum in a version check, they wrap just the fields. This means that on 10.6 that enum will be empty, which is illegal.
|
||||
// As only one other person on the entire internet has had this problem (TODO get link) and no one ever replied to his report, we're on our own here. This is dumb and will break compile-time availability and deprecation checks, but we don't have many other options.
|
||||
// I could use SDKs here, but on 10.6 itself Xcode 4.3, which changed the location of SDKs, is only available to people with a paid Apple developer account, and Beelsebob on irc.freenode.net/#macdev told me that any other configuration is likely to have a differnet directory entirely, so...
|
||||
// Of course, if Go were ever to drop 10.6 support, this problem would go away (hopefully).
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
||||
# MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_3
|
||||
#include <AppKit/NSApplication.h>
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
|
||||
|
||||
// NSWindow.h is below because it includes NSApplication.h
|
||||
// we'll use the other headers's include guards so if the above is resolved and I forget to uncomment anything below it won't matter
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
|
|
|
@ -4,6 +4,21 @@
|
|||
#include <Foundation/NSDictionary.h>
|
||||
#include <AppKit/NSArrayController.h>
|
||||
#include <AppKit/NSTableColumn.h>
|
||||
|
||||
// see delegateuitask_darwin.m
|
||||
// in this case, NSTableView.h includes NSApplication.h
|
||||
#include <Foundation/NSIndexSet.h>
|
||||
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
||||
#include <AppKit/NSApplication.h>
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
|
||||
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <Foundation/NSIndexSet.h>
|
||||
|
||||
|
|
|
@ -2,7 +2,23 @@
|
|||
|
||||
#include "objc_darwin.h"
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
// see delegateuitask_darwin.m
|
||||
// in this case, NSScrollView.h includes NSApplication.h
|
||||
// NOTE NSView.h apparently lacks include guards; we'll need to uncomment the one below
|
||||
#include <AppKit/NSView.h>
|
||||
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
||||
#include <AppKit/NSApplication.h>
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
|
||||
|
||||
//#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSScrollView.h>
|
||||
|
||||
#define to(T, x) ((T *) (x))
|
||||
|
|
|
@ -2,6 +2,20 @@
|
|||
|
||||
#include "objc_darwin.h"
|
||||
#include <AppKit/NSControl.h>
|
||||
|
||||
// see delegateuitask_darwin.m
|
||||
// in this case, NSScrollView.h, NSTableView.h, AND NSProgressIndicator.h all include NSApplication.h
|
||||
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
||||
#include <AppKit/NSApplication.h>
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
|
||||
|
||||
#include <AppKit/NSScrollView.h>
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <AppKit/NSProgressIndicator.h>
|
||||
|
|
|
@ -2,10 +2,27 @@
|
|||
|
||||
#include "objc_darwin.h"
|
||||
#include <Foundation/NSGeometry.h>
|
||||
|
||||
// see delegateuitask_darwin.m
|
||||
// in this case, lots of headers include NSApplication.h
|
||||
// NOTE uncomment the ones below when resolved because yay inconsistent include guard madness
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSControl.h>
|
||||
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7
|
||||
#include <AppKit/NSApplication.h>
|
||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#undef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
|
||||
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSFont.h>
|
||||
#include <AppKit/NSControl.h>
|
||||
//#include <AppKit/NSControl.h>
|
||||
#include <AppKit/NSButton.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
#include <AppKit/NSComboBox.h>
|
||||
|
|
Loading…
Reference in New Issue