Fixed a compiler warning when building with Mac OS X target < 10.7. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Thu, 03 Nov 2011 23:58:24 -0400
branchSDL-1.2
changeset 6048 a0538c8c39b5
parent 6047 54b2716f595d
child 6049 4b79fd1fd9a3
Fixed a compiler warning when building with Mac OS X target < 10.7.
src/video/quartz/SDL_QuartzVideo.m
--- a/src/video/quartz/SDL_QuartzVideo.m	Thu Nov 03 12:42:23 2011 -0400
+++ b/src/video/quartz/SDL_QuartzVideo.m	Thu Nov 03 23:58:24 2011 -0400
@@ -798,9 +798,6 @@
     /* Setup OpenGL for a fullscreen context */
     if (flags & SDL_OPENGL) {
 
-        CGLError err;
-        CGLContextObj ctx;
-
         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
             goto ERR_NO_GL;
         }
@@ -818,13 +815,18 @@
         /* Apparently Lion checks some version flag set by the linker
            and changes API behavior. Annoying. */
 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
-        [ qz_window setLevel:NSNormalWindowLevel ];
-        ctx = QZ_GetCGLContextObj (gl_context);
-        err = CGLSetFullScreen (ctx);
+        {
+            CGLError err;
+            CGLContextObj ctx;
+
+            [ qz_window setLevel:NSNormalWindowLevel ];
+            ctx = QZ_GetCGLContextObj (gl_context);
+            err = CGLSetFullScreen (ctx);
     
-        if (err) {
-            SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
-            goto ERR_NO_GL;
+            if (err) {
+                SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
+                goto ERR_NO_GL;
+            }
         }
 #else
         [ qz_window setLevel:CGShieldingWindowLevel() ];