summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/mac.H6
-rw-r--r--src/Fl_cocoa.mm5
2 files changed, 10 insertions, 1 deletions
diff --git a/FL/mac.H b/FL/mac.H
index e5f7fdb0e..3fe7b571d 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -64,6 +64,12 @@ typedef CGContextRef Fl_Offscreen;
#ifndef MAC_OS_X_VERSION_10_8
#define MAC_OS_X_VERSION_10_8 1080
#endif
+#ifndef MAC_OS_X_VERSION_10_9
+#define MAC_OS_X_VERSION_10_9 1090
+#endif
+#ifndef MAC_OS_X_VERSION_10_10
+#define MAC_OS_X_VERSION_10_10 101000
+#endif
#ifdef __OBJC__
@class NSCursor;
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 6d1e801dc..ffdb27ac4 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3870,13 +3870,16 @@ void *Fl_X::get_carbon_function(const char *function_name) {
static int calc_mac_os_version() {
int M, m, b = 0;
NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) {
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
M = version.majorVersion;
m = version.minorVersion;
b = version.patchVersion;
}
- else {
+ else
+#endif
+ {
NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
const char *s = [[sv objectForKey:@"ProductVersion"] UTF8String];
sscanf(s, "%d.%d.%d", &M, &m, &b);