diff options
| author | Manolo Gouy <Manolo> | 2014-09-13 14:29:53 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2014-09-13 14:29:53 +0000 |
| commit | 76418b352b44a489dcc05f114712892188af9fd7 (patch) | |
| tree | 73d7272768a0d1514b60b5e4da1ec7b3beec7a28 /src | |
| parent | 6482acf15af45104a25d1bbec49bc51ea1f80d6c (diff) | |
Allow compilation with SDK 10.10 and use new API to discover os version at runtime.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10305 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 5 |
1 files changed, 4 insertions, 1 deletions
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); |
