[Bf-blender-cvs] [9cefd56] master: GHost: Attempt to fix compilation error on older OSX systems

Sergey Sharybin noreply at git.blender.org
Sun Jun 14 14:36:18 CEST 2015


Commit: 9cefd5612d9a74f821fdb0d5fdaa50ad180f54c7
Author: Sergey Sharybin
Date:   Sun Jun 14 14:34:05 2015 +0200
Branches: master
https://developer.blender.org/rB9cefd5612d9a74f821fdb0d5fdaa50ad180f54c7

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.

===================================================================

M	intern/ghost/intern/GHOST_WindowCocoa.mm

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 65d371c..f1f38cc 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];




More information about the Bf-blender-cvs mailing list