From 24a5fa7632c8ed34e550a6ebac1733c296bfd274 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 6 Dec 2017 07:38:05 +0000 Subject: [PATCH] MacOS: support running fl_open_display() in static initializer. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12583 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index e550aee2e..510ed40b2 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1768,7 +1768,7 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() { if (need_new_nsapp) [NSApplication sharedApplication]; NSAutoreleasePool *localPool; localPool = [[NSAutoreleasePool alloc] init]; // never released - FLAppDelegate *delegate = (fl_mac_os_version < 100500 ? [FLAppDelegateBefore10_5 alloc] : [FLAppDelegate alloc]); + FLAppDelegate *delegate = (Fl_Darwin_System_Driver::calc_mac_os_version() < 100500 ? [FLAppDelegateBefore10_5 alloc] : [FLAppDelegate alloc]); [(NSApplication*)NSApp setDelegate:[delegate init]]; if (need_new_nsapp) { if (fl_mac_os_version >= 101300 ) { @@ -3778,7 +3778,7 @@ static void createAppleMenu(void) NSMenuItem *menuItem; NSString *title; - SEL infodictSEL = (Fl_Darwin_System_Driver::calc_mac_os_version() >= 100200 ? @selector(localizedInfoDictionary) : @selector(infoDictionary)); + SEL infodictSEL = (fl_mac_os_version >= 100200 ? @selector(localizedInfoDictionary) : @selector(infoDictionary)); NSString *nsappname = [[[NSBundle mainBundle] performSelector:infodictSEL] objectForKey:@"CFBundleName"]; if (nsappname == nil) nsappname = [[NSProcessInfo processInfo] processName];