From 989ac438fc789f41aac44aa178e8e991267cffb3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 20 May 2014 08:35:39 -0400 Subject: [PATCH] Fixed the whole NSApplication.h thing so now the project builds with both 10.6 and 10.8. Ugh. --- delegateuitask_darwin.m | 4 +++- listbox_darwin.m | 2 ++ objc_darwin.m | 2 ++ prefsize_darwin.m | 2 ++ sysdata_darwin.m | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/delegateuitask_darwin.m b/delegateuitask_darwin.m index b45f680..a49fda3 100644 --- a/delegateuitask_darwin.m +++ b/delegateuitask_darwin.m @@ -15,11 +15,13 @@ // 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). +// Oh, and Xcode 4.2 for Snow Leopard comes with headers that don't include MAC_OS_X_VERSION_10_7 and thus won't have this problem, so we need to watch for that too... +#ifdef MAC_OS_X_VERSION_10_7 #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 +#endif #import #undef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/listbox_darwin.m b/listbox_darwin.m index 4754a3f..18a9649 100644 --- a/listbox_darwin.m +++ b/listbox_darwin.m @@ -9,10 +9,12 @@ // in this case, NSTableView.h includes NSApplication.h #import +#ifdef MAC_OS_X_VERSION_10_7 #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 +#endif #import #undef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/objc_darwin.m b/objc_darwin.m index 79966c9..918bc7e 100644 --- a/objc_darwin.m +++ b/objc_darwin.m @@ -7,10 +7,12 @@ // in this case, NSScrollView.h includes NSApplication.h #import +#ifdef MAC_OS_X_VERSION_10_7 #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 +#endif #import #undef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/prefsize_darwin.m b/prefsize_darwin.m index 34a0dcd..521b767 100644 --- a/prefsize_darwin.m +++ b/prefsize_darwin.m @@ -6,10 +6,12 @@ // see delegateuitask_darwin.m // in this case, NSScrollView.h, NSTableView.h, AND NSProgressIndicator.h all include NSApplication.h +#ifdef MAC_OS_X_VERSION_10_7 #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 +#endif #import #undef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MAX_ALLOWED diff --git a/sysdata_darwin.m b/sysdata_darwin.m index 46c19e0..207cee8 100644 --- a/sysdata_darwin.m +++ b/sysdata_darwin.m @@ -8,10 +8,12 @@ #import #import +#ifdef MAC_OS_X_VERSION_10_7 #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 +#endif #import #undef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MAX_ALLOWED