summaryrefslogtreecommitdiff
path: root/gdk/quartz/gdkglobals-quartz.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk/quartz/gdkglobals-quartz.c')
-rw-r--r--gdk/quartz/gdkglobals-quartz.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c
index a185d2a79a..c6a7a227bb 100644
--- a/gdk/quartz/gdkglobals-quartz.c
+++ b/gdk/quartz/gdkglobals-quartz.c
@@ -28,9 +28,14 @@ GdkWindow *_gdk_root = NULL;
GdkOSXVersion
gdk_quartz_osx_version (void)
{
- gint minor;
- OSErr err = Gestalt (gestaltSystemVersionMinor, &minor);
- g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
+ static gint32 minor = 0;
+
+ if (!minor)
+ {
+ OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
+
+ g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
+ }
if (minor < GDK_OSX_MIN)
return GDK_OSX_UNSUPPORTED;