From 9cefd5612d9a74f821fdb0d5fdaa50ad180f54c7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 14 Jun 2015 14:34:05 +0200 Subject: GHost: Attempt to fix compilation error on older OSX systems The issue was caused by using NotificationCenter which is only available since 10.9 so trying to build blender on OSX with 10.7 SDK would fail. Now it should be possible to build blender with SDK 10.7 and at the same time official builds should still be doing proper weak-linking to a notification center. --- intern/ghost/intern/GHOST_WindowCocoa.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 65d371c8ca8..f1f38cc14b3 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -1328,6 +1328,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress) return GHOST_kSuccess; } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 static void postNotification() { NSUserNotification *notification = [[NSUserNotification alloc] init]; @@ -1337,7 +1338,8 @@ static void postNotification() [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; [notification release]; } - +#endif + GHOST_TSuccess GHOST_WindowCocoa::endProgressBar() { if (!m_progressBarVisible) return GHOST_kFailure; @@ -1355,11 +1357,12 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar() // With OSX 10.8 and later, we can use notifications to inform the user when the progress reached 100% // Atm. just fire this when the progressbar ends, the behavior is controlled in the NotificationCenter // If Blender is not frontmost window, a message pops up with sound, in any case an entry in notifications - +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) { postNotification(); } - +#endif + [dockIcon release]; [pool drain]; -- cgit v1.2.3