Bump SDL to build with 10.7 SDK.
authorSam Lantinga <slouken@libsdl.org>
Fri, 27 Dec 2013 10:18:11 -0800
changeset 80833782a12331d6
parent 8082 5b83ad3f01ac
child 8084 96b1986b1e61
Bump SDL to build with 10.7 SDK.

This also bumps the minimum requirement for building SDL to 10.7, and
removes some checking we no longer need.

CR: saml
include/SDL_platform.h
src/video/cocoa/SDL_cocoaopengl.m
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/include/SDL_platform.h	Fri Dec 27 09:29:39 2013 -0300
     1.2 +++ b/include/SDL_platform.h	Fri Dec 27 10:18:11 2013 -0800
     1.3 @@ -82,9 +82,6 @@
     1.4  #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
     1.5  # error SDL for Mac OS X only supports deploying on 10.5 and above.
     1.6  #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
     1.7 -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
     1.8 -# error SDL for Mac OS X must be built with a 10.6 SDK or above.
     1.9 -#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */
    1.10  #endif /* TARGET_OS_IPHONE */
    1.11  #endif /* defined(__APPLE__) */
    1.12  
     2.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Fri Dec 27 09:29:39 2013 -0300
     2.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Fri Dec 27 10:18:11 2013 -0800
     2.3 @@ -35,19 +35,6 @@
     2.4  
     2.5  #define DEFAULT_OPENGL  "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
     2.6  
     2.7 -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
     2.8 -/* New methods for converting to and from backing store pixels, taken from
     2.9 - * AppKit/NSView.h in 10.8 SDK. */
    2.10 -@interface NSView (Backing)
    2.11 -- (NSPoint)convertPointToBacking:(NSPoint)aPoint;
    2.12 -- (NSPoint)convertPointFromBacking:(NSPoint)aPoint;
    2.13 -- (NSSize)convertSizeToBacking:(NSSize)aSize;
    2.14 -- (NSSize)convertSizeFromBacking:(NSSize)aSize;
    2.15 -- (NSRect)convertRectToBacking:(NSRect)aRect;
    2.16 -- (NSRect)convertRectFromBacking:(NSRect)aRect;
    2.17 -@end
    2.18 -#endif
    2.19 -
    2.20  #ifndef kCGLPFAOpenGLProfile
    2.21  #define kCGLPFAOpenGLProfile 99
    2.22  #endif
     3.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 27 09:29:39 2013 -0300
     3.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 27 10:18:11 2013 -0800
     3.3 @@ -22,6 +22,10 @@
     3.4  
     3.5  #if SDL_VIDEO_DRIVER_COCOA
     3.6  
     3.7 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
     3.8 +# error SDL for Mac OS X must be built with a 10.7 SDK or above.
     3.9 +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1070 */
    3.10 +
    3.11  #include "SDL_syswm.h"
    3.12  #include "SDL_timer.h"  /* For SDL_GetTicks() */
    3.13  #include "SDL_hints.h"
    3.14 @@ -35,14 +39,6 @@
    3.15  #include "SDL_cocoamouse.h"
    3.16  #include "SDL_cocoaopengl.h"
    3.17  
    3.18 -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
    3.19 -/* Taken from AppKit/NSOpenGLView.h in 10.8 SDK. */
    3.20 -@interface NSView (NSOpenGLSurfaceResolution)
    3.21 -- (BOOL)wantsBestResolutionOpenGLSurface;
    3.22 -- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
    3.23 -@end
    3.24 -#endif
    3.25 -
    3.26  static Uint32 s_moveHack;
    3.27  
    3.28  static void ConvertNSRect(NSRect *r)
    3.29 @@ -140,12 +136,10 @@
    3.30          [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
    3.31          [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
    3.32          [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
    3.33 -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    3.34          [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window];
    3.35          [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window];
    3.36          [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window];
    3.37          [center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window];
    3.38 -#endif /* Mac OS X 10.7+ */
    3.39      } else {
    3.40          [window setDelegate:self];
    3.41      }
    3.42 @@ -211,7 +205,6 @@
    3.43  
    3.44  -(BOOL) setFullscreenSpace:(BOOL) state;
    3.45  {
    3.46 -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    3.47      SDL_Window *window = _data->window;
    3.48      NSWindow *nswindow = _data->nswindow;
    3.49  
    3.50 @@ -245,9 +238,6 @@
    3.51  
    3.52      [nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO];
    3.53      return YES;
    3.54 -#else
    3.55 -    return NO;
    3.56 -#endif /* SDK >= 10.7 */
    3.57  }
    3.58  
    3.59  -(BOOL) isInFullscreenSpace
    3.60 @@ -282,12 +272,10 @@
    3.61          [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
    3.62          [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
    3.63          [center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
    3.64 -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    3.65          [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window];
    3.66          [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window];
    3.67          [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window];
    3.68          [center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window];
    3.69 -#endif /* Mac OS X 10.7+ */
    3.70      } else {
    3.71          [window setDelegate:nil];
    3.72      }
    3.73 @@ -931,14 +919,12 @@
    3.74          return -1;
    3.75      }
    3.76      [nswindow setBackgroundColor:[NSColor blackColor]];
    3.77 -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    3.78      if ([nswindow respondsToSelector:@selector(setCollectionBehavior:)]) {
    3.79          const char *hint = SDL_GetHint(SDL_HINT_VIDEO_FULLSCREEN_SPACES);
    3.80          if (hint && SDL_atoi(hint) > 0) {
    3.81              [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
    3.82          }
    3.83      }
    3.84 -#endif
    3.85  
    3.86      /* Create a default view for this window */
    3.87      rect = [nswindow contentRectForFrameRect:[nswindow frame]];
    3.88 @@ -1419,7 +1405,6 @@
    3.89  Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool state)
    3.90  {
    3.91      SDL_bool succeeded = SDL_FALSE;
    3.92 -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    3.93      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    3.94      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    3.95  
    3.96 @@ -1428,7 +1413,6 @@
    3.97      }
    3.98  
    3.99      [pool release];
   3.100 -#endif /* SDK 10.7+ */
   3.101  
   3.102      return succeeded;
   3.103  }