[Bf-blender-cvs] [98bf395] master: OSX: replace deprecated (10.8 ) Gestalt function with utsname, no functional change

Jens Verwiebe noreply at git.blender.org
Thu Jun 5 22:14:34 CEST 2014


Commit: 98bf3959b484216000c48d12666ce6120ca15f99
Author: Jens Verwiebe
Date:   Thu Jun 5 22:14:14 2014 +0200
https://developer.blender.org/rB98bf3959b484216000c48d12666ce6120ca15f99

OSX: replace deprecated (10.8 ) Gestalt function with utsname, no functional change

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

M	intern/ghost/intern/GHOST_WindowCocoa.mm

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

diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 95bf060..0dcc0ff 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -44,6 +44,9 @@
 #include "GHOST_SystemCocoa.h"
 #include "GHOST_Debug.h"
 
+/* OSX version detection @ runtime */
+#include <sys/utsname.h>
+
 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
 /* Lion style fullscreen support when building with the 10.6 SDK */
 enum {
@@ -726,14 +729,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
 	if (state == GHOST_kWindowStateFullScreen)
 		setState(GHOST_kWindowStateFullScreen);
 
-	//Starting with 10.9, we always use Lion fullscreen, since it
+	//Starting with 10.9 (darwin 13.x.x), we always use Lion fullscreen, since it
 	//now has proper multi-monitor support for fullscreen
-	struct { SInt32 major, minor; } systemversion;
-	Gestalt(gestaltSystemVersionMajor, &systemversion.major);
-	Gestalt(gestaltSystemVersionMinor, &systemversion.minor);
-
-	m_lionStyleFullScreen = (systemversion.major > 10 || (systemversion.major == 10 && systemversion.minor >= 9));
-		
+	struct utsname retval;
+	uname(&retval);
+	if(retval.release[0] == '1' && retval.release[1] <= '3') {
+		m_lionStyleFullScreen = true;
+	}
+	
 	[pool drain];
 }




More information about the Bf-blender-cvs mailing list