Ticket #52210: patch-SDL2-2.0.3_OSX_105.diff
File patch-SDL2-2.0.3_OSX_105.diff, 22.5 KB (added by kencu (Ken), 7 years ago) |
---|
-
include/SDL_config.h
Only in SDL2-2.0.3: Makefile Only in SDL2-2.0.3: Makefile.rules Only in SDL2-2.0.3: build Only in SDL2-2.0.3: config.log Only in SDL2-2.0.3: config.status diff -ru SDL2-2.0.3-orig/include/SDL_config.h SDL2-2.0.3/include/SDL_config.h
old new 1 /* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ 1 2 /* 2 3 Simple DirectMedia Layer 3 4 Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> … … 22 23 #ifndef _SDL_config_h 23 24 #define _SDL_config_h 24 25 25 #include "SDL_platform.h"26 27 26 /** 28 * \file SDL_config.h 27 * \file SDL_config.h.in 28 * 29 * This is a set of defines to configure the SDL features 29 30 */ 30 31 31 /* Add any platform that doesn't build using the configure system. */ 32 #ifdef USING_PREMAKE_CONFIG_H 33 #include "SDL_config_premake.h" 34 #elif defined(__WIN32__) 35 #include "SDL_config_windows.h" 36 #elif defined(__WINRT__) 37 #include "SDL_config_winrt.h" 38 #elif defined(__MACOSX__) 39 #include "SDL_config_macosx.h" 40 #elif defined(__IPHONEOS__) 41 #include "SDL_config_iphoneos.h" 42 #elif defined(__ANDROID__) 43 #include "SDL_config_android.h" 44 #elif defined(__PSP__) 45 #include "SDL_config_psp.h" 32 /* General platform specific identifiers */ 33 #include "SDL_platform.h" 34 35 /* Make sure that this isn't included by Visual C++ */ 36 #ifdef _MSC_VER 37 #error You should run hg revert SDL_config.h 38 #endif 39 40 /* C language features */ 41 /* #undef const */ 42 /* #undef inline */ 43 /* #undef volatile */ 44 45 /* C datatypes */ 46 #ifdef __LP64__ 47 #define SIZEOF_VOIDP 8 46 48 #else 47 /* This is a minimal configuration just to get SDL running on new platforms */ 48 #include "SDL_config_minimal.h" 49 #endif /* platform config */ 49 #define SIZEOF_VOIDP 4 50 #endif 51 /* #undef HAVE_GCC_ATOMICS */ 52 /* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ 53 /* #undef HAVE_PTHREAD_SPINLOCK */ 54 55 /* Comment this if you want to build without any C library requirements */ 56 #define HAVE_LIBC 1 57 #if HAVE_LIBC 58 59 /* Useful headers */ 60 #define HAVE_ALLOCA_H 1 61 #define HAVE_SYS_TYPES_H 1 62 #define HAVE_STDIO_H 1 63 #define STDC_HEADERS 1 64 #define HAVE_STDLIB_H 1 65 #define HAVE_STDARG_H 1 66 /* #undef HAVE_MALLOC_H */ 67 #define HAVE_MEMORY_H 1 68 #define HAVE_STRING_H 1 69 #define HAVE_STRINGS_H 1 70 #define HAVE_INTTYPES_H 1 71 #define HAVE_STDINT_H 1 72 #define HAVE_CTYPE_H 1 73 #define HAVE_MATH_H 1 74 #define HAVE_ICONV_H 1 75 #define HAVE_SIGNAL_H 1 76 #define HAVE_ALTIVEC_H 1 77 /* #undef HAVE_PTHREAD_NP_H */ 78 /* #undef HAVE_LIBUDEV_H */ 79 /* #undef HAVE_DBUS_DBUS_H */ 50 80 51 #ifdef USING_GENERATED_CONFIG_H 52 #error Wrong SDL_config.h, check your include path? 81 /* C library functions */ 82 #define HAVE_MALLOC 1 83 #define HAVE_CALLOC 1 84 #define HAVE_REALLOC 1 85 #define HAVE_FREE 1 86 #define HAVE_ALLOCA 1 87 #ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ 88 #define HAVE_GETENV 1 89 #define HAVE_SETENV 1 90 #define HAVE_PUTENV 1 91 #define HAVE_UNSETENV 1 53 92 #endif 93 #define HAVE_QSORT 1 94 #define HAVE_ABS 1 95 #define HAVE_BCOPY 1 96 #define HAVE_MEMSET 1 97 #define HAVE_MEMCPY 1 98 #define HAVE_MEMMOVE 1 99 #define HAVE_MEMCMP 1 100 #define HAVE_STRLEN 1 101 #define HAVE_STRLCPY 1 102 #define HAVE_STRLCAT 1 103 #define HAVE_STRDUP 1 104 /* #undef HAVE__STRREV */ 105 /* #undef HAVE__STRUPR */ 106 /* #undef HAVE__STRLWR */ 107 /* #undef HAVE_INDEX */ 108 /* #undef HAVE_RINDEX */ 109 #define HAVE_STRCHR 1 110 #define HAVE_STRRCHR 1 111 #define HAVE_STRSTR 1 112 /* #undef HAVE_ITOA */ 113 /* #undef HAVE__LTOA */ 114 /* #undef HAVE__UITOA */ 115 /* #undef HAVE__ULTOA */ 116 #define HAVE_STRTOL 1 117 #define HAVE_STRTOUL 1 118 /* #undef HAVE__I64TOA */ 119 /* #undef HAVE__UI64TOA */ 120 #define HAVE_STRTOLL 1 121 #define HAVE_STRTOULL 1 122 #define HAVE_STRTOD 1 123 #define HAVE_ATOI 1 124 #define HAVE_ATOF 1 125 #define HAVE_STRCMP 1 126 #define HAVE_STRNCMP 1 127 /* #undef HAVE__STRICMP */ 128 #define HAVE_STRCASECMP 1 129 /* #undef HAVE__STRNICMP */ 130 #define HAVE_STRNCASECMP 1 131 /* #undef HAVE_SSCANF */ 132 #define HAVE_VSSCANF 1 133 /* #undef HAVE_SNPRINTF */ 134 #define HAVE_VSNPRINTF 1 135 #define HAVE_M_PI /**/ 136 #define HAVE_ATAN 1 137 #define HAVE_ATAN2 1 138 #define HAVE_ACOS 1 139 #define HAVE_ASIN 1 140 #define HAVE_CEIL 1 141 #define HAVE_COPYSIGN 1 142 #define HAVE_COS 1 143 #define HAVE_COSF 1 144 #define HAVE_FABS 1 145 #define HAVE_FLOOR 1 146 #define HAVE_LOG 1 147 #define HAVE_POW 1 148 #define HAVE_SCALBN 1 149 #define HAVE_SIN 1 150 #define HAVE_SINF 1 151 #define HAVE_SQRT 1 152 #define HAVE_FSEEKO 1 153 /* #undef HAVE_FSEEKO64 */ 154 #define HAVE_SIGACTION 1 155 #define HAVE_SA_SIGACTION 1 156 #define HAVE_SETJMP 1 157 #define HAVE_NANOSLEEP 1 158 #define HAVE_SYSCONF 1 159 #define HAVE_SYSCTLBYNAME 1 160 /* #undef HAVE_CLOCK_GETTIME */ 161 /* #undef HAVE_GETPAGESIZE */ 162 #define HAVE_MPROTECT 1 163 #define HAVE_ICONV 1 164 /* #undef HAVE_PTHREAD_SETNAME_NP */ 165 /* #undef HAVE_PTHREAD_SET_NAME_NP */ 166 /* #undef HAVE_SEM_TIMEDWAIT */ 167 168 #else 169 #define HAVE_STDARG_H 1 170 #define HAVE_STDDEF_H 1 171 #define HAVE_STDINT_H 1 172 #endif /* HAVE_LIBC */ 173 174 /* SDL internal assertion support */ 175 /* #undef SDL_DEFAULT_ASSERT_LEVEL */ 176 177 /* Allow disabling of core subsystems */ 178 /* #undef SDL_ATOMIC_DISABLED */ 179 /* #undef SDL_AUDIO_DISABLED */ 180 /* #undef SDL_CPUINFO_DISABLED */ 181 /* #undef SDL_EVENTS_DISABLED */ 182 /* #undef SDL_FILE_DISABLED */ 183 /* #undef SDL_JOYSTICK_DISABLED */ 184 /* #undef SDL_HAPTIC_DISABLED */ 185 /* #undef SDL_LOADSO_DISABLED */ 186 /* #undef SDL_RENDER_DISABLED */ 187 /* #undef SDL_THREADS_DISABLED */ 188 /* #undef SDL_TIMERS_DISABLED */ 189 /* #undef SDL_VIDEO_DISABLED */ 190 /* #undef SDL_POWER_DISABLED */ 191 /* #undef SDL_FILESYSTEM_DISABLED */ 192 193 /* Enable various audio drivers */ 194 /* #undef SDL_AUDIO_DRIVER_ALSA */ 195 /* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ 196 /* #undef SDL_AUDIO_DRIVER_ARTS */ 197 /* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ 198 /* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */ 199 /* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */ 200 /* #undef SDL_AUDIO_DRIVER_HAIKU */ 201 /* #undef SDL_AUDIO_DRIVER_BSD */ 202 #define SDL_AUDIO_DRIVER_COREAUDIO 1 203 #define SDL_AUDIO_DRIVER_DISK 1 204 #define SDL_AUDIO_DRIVER_DUMMY 1 205 /* #undef SDL_AUDIO_DRIVER_XAUDIO2 */ 206 /* #undef SDL_AUDIO_DRIVER_DSOUND */ 207 /* #undef SDL_AUDIO_DRIVER_ESD */ 208 /* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */ 209 /* #undef SDL_AUDIO_DRIVER_NAS */ 210 /* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */ 211 /* #undef SDL_AUDIO_DRIVER_SNDIO */ 212 /* #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */ 213 /* #undef SDL_AUDIO_DRIVER_OSS */ 214 /* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */ 215 /* #undef SDL_AUDIO_DRIVER_PAUDIO */ 216 /* #undef SDL_AUDIO_DRIVER_QSA */ 217 /* #undef SDL_AUDIO_DRIVER_SUNAUDIO */ 218 /* #undef SDL_AUDIO_DRIVER_WINMM */ 219 /* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */ 220 /* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ 221 222 /* Enable various input drivers */ 223 /* #undef SDL_INPUT_LINUXEV */ 224 /* #undef SDL_INPUT_LINUXKD */ 225 /* #undef SDL_INPUT_TSLIB */ 226 /* #undef SDL_JOYSTICK_HAIKU */ 227 /* #undef SDL_JOYSTICK_DINPUT */ 228 /* #undef SDL_JOYSTICK_DUMMY */ 229 #define SDL_JOYSTICK_IOKIT 1 230 /* #undef SDL_JOYSTICK_LINUX */ 231 /* #undef SDL_JOYSTICK_WINMM */ 232 /* #undef SDL_JOYSTICK_USBHID */ 233 /* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */ 234 /* #undef SDL_HAPTIC_DUMMY */ 235 /* #undef SDL_HAPTIC_LINUX */ 236 #define SDL_HAPTIC_IOKIT 1 237 /* #undef SDL_HAPTIC_DINPUT */ 238 239 /* Enable various shared object loading systems */ 240 /* #undef SDL_LOADSO_HAIKU */ 241 #define SDL_LOADSO_DLOPEN 1 242 /* #undef SDL_LOADSO_DUMMY */ 243 /* #undef SDL_LOADSO_LDG */ 244 /* #undef SDL_LOADSO_WINDOWS */ 245 246 /* Enable various threading systems */ 247 #define SDL_THREAD_PTHREAD 1 248 #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 249 /* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */ 250 /* #undef SDL_THREAD_WINDOWS */ 251 252 /* Enable various timer systems */ 253 /* #undef SDL_TIMER_HAIKU */ 254 /* #undef SDL_TIMER_DUMMY */ 255 #define SDL_TIMER_UNIX 1 256 /* #undef SDL_TIMER_WINDOWS */ 257 258 /* Enable various video drivers */ 259 /* #undef SDL_VIDEO_DRIVER_HAIKU */ 260 #define SDL_VIDEO_DRIVER_COCOA 1 261 /* #undef SDL_VIDEO_DRIVER_DIRECTFB */ 262 /* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */ 263 #define SDL_VIDEO_DRIVER_DUMMY 1 264 /* #undef SDL_VIDEO_DRIVER_WINDOWS */ 265 /* #undef SDL_VIDEO_DRIVER_WAYLAND */ 266 /* #undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ 267 /* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */ 268 /* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL */ 269 /* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR */ 270 /* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON */ 271 /* #undef SDL_VIDEO_DRIVER_MIR */ 272 /* #undef SDL_VIDEO_DRIVER_MIR_DYNAMIC */ 273 /* #undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON */ 274 /* #undef SDL_VIDEO_DRIVER_X11 */ 275 /* #undef SDL_VIDEO_DRIVER_RPI */ 276 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */ 277 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */ 278 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */ 279 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */ 280 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 */ 281 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */ 282 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */ 283 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */ 284 /* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */ 285 /* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */ 286 /* #undef SDL_VIDEO_DRIVER_X11_XINPUT2 */ 287 /* #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */ 288 /* #undef SDL_VIDEO_DRIVER_X11_XRANDR */ 289 /* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ 290 /* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */ 291 /* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */ 292 /* #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ 293 /* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 */ 294 /* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY */ 295 /* #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM */ 296 297 /* #undef SDL_VIDEO_RENDER_D3D */ 298 /* #undef SDL_VIDEO_RENDER_D3D11 */ 299 #define SDL_VIDEO_RENDER_OGL 1 300 /* #undef SDL_VIDEO_RENDER_OGL_ES */ 301 /* #undef SDL_VIDEO_RENDER_OGL_ES2 */ 302 /* #undef SDL_VIDEO_RENDER_DIRECTFB */ 303 304 /* Enable OpenGL support */ 305 #define SDL_VIDEO_OPENGL 1 306 /* #undef SDL_VIDEO_OPENGL_ES */ 307 /* #undef SDL_VIDEO_OPENGL_ES2 */ 308 /* #undef SDL_VIDEO_OPENGL_BGL */ 309 #define SDL_VIDEO_OPENGL_CGL 1 310 /* #undef SDL_VIDEO_OPENGL_EGL */ 311 /* #undef SDL_VIDEO_OPENGL_GLX */ 312 /* #undef SDL_VIDEO_OPENGL_WGL */ 313 /* #undef SDL_VIDEO_OPENGL_OSMESA */ 314 /* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */ 315 316 /* Enable system power support */ 317 /* #undef SDL_POWER_LINUX */ 318 /* #undef SDL_POWER_WINDOWS */ 319 #define SDL_POWER_MACOSX 1 320 /* #undef SDL_POWER_HAIKU */ 321 /* #undef SDL_POWER_HARDWIRED */ 322 323 /* Enable system filesystem support */ 324 /* #undef SDL_FILESYSTEM_HAIKU */ 325 #define SDL_FILESYSTEM_COCOA 1 326 /* #undef SDL_FILESYSTEM_DUMMY */ 327 /* #undef SDL_FILESYSTEM_UNIX */ 328 /* #undef SDL_FILESYSTEM_WINDOWS */ 329 330 /* Enable assembly routines */ 331 #define SDL_ASSEMBLY_ROUTINES 1 332 #define SDL_ALTIVEC_BLITTERS 1 54 333 55 334 #endif /* _SDL_config_h */ -
include/SDL_platform.h
diff -ru SDL2-2.0.3-orig/include/SDL_platform.h SDL2-2.0.3/include/SDL_platform.h
old new 70 70 /* lets us know what version of Mac OS X we're compiling on */ 71 71 #include "AvailabilityMacros.h" 72 72 #include "TargetConditionals.h" 73 #if TARGET_OS_IPHONE73 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE 74 74 /* if compiling for iPhone */ 75 75 #undef __IPHONEOS__ 76 76 #define __IPHONEOS__ 1 … … 80 80 #undef __MACOSX__ 81 81 #define __MACOSX__ 1 82 82 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 83 #if 0 83 84 # error SDL for Mac OS X only supports deploying on 10.5 and above. 85 #endif 84 86 #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ 85 87 #endif /* TARGET_OS_IPHONE */ 86 88 #endif /* defined(__APPLE__) */ -
src/joystick/darwin/SDL_sysjoystick.c
Only in SDL2-2.0.3: libtool Only in SDL2-2.0.3: sdl2-config Only in SDL2-2.0.3: sdl2.pc diff -ru SDL2-2.0.3-orig/src/joystick/darwin/SDL_sysjoystick.c SDL2-2.0.3/src/joystick/darwin/SDL_sysjoystick.c
old new 384 384 device->instance_id = ++s_joystick_instance_id; 385 385 386 386 /* We have to do some storage of the io_service_t for SDL_HapticOpenFromJoystick */ 387 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 387 388 if (IOHIDDeviceGetService != NULL) { /* weak reference: available in 10.6 and later. */ 388 389 const io_service_t ioservice = IOHIDDeviceGetService(ioHIDDeviceObject); 389 390 if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK)) { … … 393 394 #endif 394 395 } 395 396 } 397 #endif 396 398 397 399 device->send_open_event = 1; 398 400 s_bDeviceAdded = SDL_TRUE; -
src/video/cocoa/SDL_cocoaclipboard.m
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoaclipboard.m SDL2-2.0.3/src/video/cocoa/SDL_cocoaclipboard.m
old new 30 30 { 31 31 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; 32 32 33 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 33 34 if (data->osversion >= 0x1060) { 34 35 return NSPasteboardTypeString; 35 36 } else { 37 #endif 36 38 return NSStringPboardType; 39 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 37 40 } 41 #endif 38 42 } 39 43 40 44 int -
src/video/cocoa/SDL_cocoamodes.m
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoamodes.m SDL2-2.0.3/src/video/cocoa/SDL_cocoamodes.m
old new 127 127 } 128 128 data->moderef = moderef; 129 129 130 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 130 131 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 131 132 CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef; 132 133 CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode); … … 146 147 147 148 CFRelease(fmt); 148 149 } 150 #endif 149 151 150 152 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 151 153 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { … … 184 186 static void 185 187 Cocoa_ReleaseDisplayMode(_THIS, const void *moderef) 186 188 { 189 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 187 190 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 188 191 CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */ 189 192 } 193 #endif 190 194 } 191 195 192 196 static void 193 197 Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist) 194 198 { 199 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 195 200 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 196 201 CFRelease(modelist); /* NULL is ok */ 197 202 } 203 #endif 198 204 } 199 205 200 206 static const char * … … 257 263 continue; 258 264 } 259 265 266 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 260 267 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 261 268 moderef = CGDisplayCopyDisplayMode(displays[i]); 262 269 } 270 #endif 263 271 264 272 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 265 273 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { … … 319 327 SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; 320 328 CFArrayRef modes = NULL; 321 329 330 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 322 331 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 323 332 modes = CGDisplayCopyAllDisplayModes(data->display, NULL); 324 333 } 334 #endif 325 335 326 336 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 327 337 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { … … 337 347 const void *moderef = CFArrayGetValueAtIndex(modes, i); 338 348 SDL_DisplayMode mode; 339 349 if (GetDisplayMode(_this, moderef, &mode)) { 350 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 340 351 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 341 352 CGDisplayModeRetain((CGDisplayModeRef) moderef); 342 353 } 354 #endif 343 355 SDL_AddDisplayMode(display, &mode); 344 356 } 345 357 } … … 351 363 static CGError 352 364 Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode) 353 365 { 366 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 354 367 if (IS_SNOW_LEOPARD_OR_LATER(_this)) { 355 368 return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL); 356 369 } 370 #endif 357 371 358 372 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 359 373 if (!IS_SNOW_LEOPARD_OR_LATER(_this)) { -
src/video/cocoa/SDL_cocoaopengl.m
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoaopengl.m SDL2-2.0.3/src/video/cocoa/SDL_cocoaopengl.m
old new 347 347 348 348 /* This gives us the correct viewport for a Retina-enabled view, only 349 349 * supported on 10.7+. */ 350 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 350 351 if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) { 351 352 viewport = [contentView convertRectToBacking:viewport]; 352 353 } 354 #endif 353 355 354 356 if (w) { 355 357 *w = viewport.size.width; -
src/video/cocoa/SDL_cocoawindow.h
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoawindow.h SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.h
old new 35 35 PENDING_OPERATION_MINIMIZE 36 36 } PendingWindowOperation; 37 37 38 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 38 39 @interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> { 40 #else 41 @interface Cocoa_WindowListener : NSResponder { 42 #endif 39 43 SDL_WindowData *_data; 40 44 BOOL observingVisible; 41 45 BOOL wasCtrlLeft; … … 73 77 -(void) windowDidEnterFullScreen:(NSNotification *) aNotification; 74 78 -(void) windowWillExitFullScreen:(NSNotification *) aNotification; 75 79 -(void) windowDidExitFullScreen:(NSNotification *) aNotification; 80 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 76 81 -(NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions; 82 #endif 77 83 78 84 /* Window event handling */ 79 85 -(void) mouseDown:(NSEvent *) theEvent; -
src/video/cocoa/SDL_cocoawindow.m
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoawindow.m SDL2-2.0.3/src/video/cocoa/SDL_cocoawindow.m
old new 23 23 #if SDL_VIDEO_DRIVER_COCOA 24 24 25 25 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 26 #if 0 26 27 # error SDL for Mac OS X must be built with a 10.7 SDK or above. 28 #endif 27 29 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1070 */ 28 30 29 31 #include "SDL_syswm.h" … … 190 192 [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window]; 191 193 [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window]; 192 194 [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window]; 195 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 193 196 [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window]; 194 197 [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window]; 195 198 [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window]; 196 199 [center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window]; 200 #endif 197 201 } else { 198 202 [window setDelegate:self]; 199 203 } … … 212 216 213 217 [view setNextResponder:self]; 214 218 219 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 215 220 if ([view respondsToSelector:@selector(setAcceptsTouchEvents:)]) { 216 221 [view setAcceptsTouchEvents:YES]; 217 222 } 223 #endif 218 224 } 219 225 220 226 - (void)observeValueForKeyPath:(NSString *)keyPath … … 282 288 inFullscreenTransition = YES; 283 289 284 290 /* you need to be FullScreenPrimary, or toggleFullScreen doesn't work. Unset it again in windowDidExitFullScreen. */ 291 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 285 292 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 293 #endif 286 294 [nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO]; 287 295 return YES; 288 296 } … … 319 327 [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window]; 320 328 [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window]; 321 329 [center removeObserver:self name:NSWindowDidResignKeyNotification object:window]; 330 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 322 331 [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window]; 323 332 [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window]; 324 333 [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window]; 325 334 [center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window]; 335 #endif 326 336 } else { 327 337 [window setDelegate:nil]; 328 338 } … … 597 607 [nswindow miniaturize:nil]; 598 608 } else { 599 609 /* Adjust the fullscreen toggle button and readd menu now that we're here. */ 610 #if MAC_OS_X_VERSION_MIN_REQUIRED > 1070 600 611 if (window->flags & SDL_WINDOW_RESIZABLE) { 601 612 /* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */ 602 613 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 603 614 } else { 604 615 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorManaged]; 605 616 } 617 #endif 606 618 [NSMenu setMenuBarVisible:YES]; 607 619 608 620 pendingWindowOperation = PENDING_OPERATION_NONE; … … 620 632 } 621 633 } 622 634 635 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 623 636 -(NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions 624 637 { 625 638 if ((_data->window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) { … … 628 641 return proposedOptions; 629 642 } 630 643 } 644 #endif 631 645 632 646 633 647 /* We'll respond to key events by doing nothing so we don't beep. … … 822 836 [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent]; 823 837 } 824 838 839 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 825 840 - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event 826 841 { 827 842 NSSet *touches = 0; … … 875 890 touch = (NSTouch*)[enumerator nextObject]; 876 891 } 877 892 } 893 #endif 878 894 879 895 @end 880 896 … … 1040 1056 [nswindow setBackgroundColor:[NSColor blackColor]]; 1041 1057 1042 1058 if (videodata->allow_spaces) { 1059 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 1043 1060 SDL_assert(videodata->osversion >= 0x1070); 1044 1061 SDL_assert([nswindow respondsToSelector:@selector(toggleFullScreen:)]); 1045 1062 /* we put FULLSCREEN_DESKTOP windows in their own Space, without a toggle button or menubar, later */ … … 1047 1064 /* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */ 1048 1065 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 1049 1066 } 1067 #endif 1050 1068 } 1051 1069 1052 1070 /* Create a default view for this window */