Ticket #52210: patch-SDL2-2.0.3_OSX_104.diff
File patch-SDL2-2.0.3_OSX_104.diff, 29.2 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 #define HAVE_GCC_ATOMICS 1 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 #define SDL_JOYSTICK_DISABLED 1 184 #define SDL_HAPTIC_DISABLED 1 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 /* #undef SDL_JOYSTICK_IOKIT */ 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 /* #undef SDL_HAPTIC_IOKIT */ 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__) */ -
include/SDL_syswm.h
diff -ru SDL2-2.0.3-orig/include/SDL_syswm.h SDL2-2.0.3/include/SDL_syswm.h
old new 83 83 84 84 #if defined(SDL_VIDEO_DRIVER_COCOA) 85 85 #ifdef __OBJC__ 86 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 87 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 88 #define vector __vector 89 #include <CoreServices/CoreServices.h> 90 #undef vector 91 #endif 86 92 #include <Cocoa/Cocoa.h> 87 93 #else 88 94 typedef struct _NSWindow NSWindow; -
src/audio/coreaudio/SDL_coreaudio.h
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/audio/coreaudio/SDL_coreaudio.h SDL2-2.0.3/src/audio/coreaudio/SDL_coreaudio.h
old new 31 31 32 32 #if MACOSX_COREAUDIO 33 33 #include <CoreAudio/CoreAudio.h> 34 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 35 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 36 #define vector __vector 34 37 #include <CoreServices/CoreServices.h> 38 #undef vector 39 #else 40 #include <CoreServices/CoreServices.h> 41 #endif 35 42 #else 36 43 #include <AudioToolbox/AudioToolbox.h> 37 44 #endif -
src/file/cocoa/SDL_rwopsbundlesupport.m
diff -ru SDL2-2.0.3-orig/src/file/cocoa/SDL_rwopsbundlesupport.m SDL2-2.0.3/src/file/cocoa/SDL_rwopsbundlesupport.m
old new 21 21 #include "../../SDL_internal.h" 22 22 23 23 #ifdef __APPLE__ 24 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 25 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 26 #define vector __vector 27 #include <CoreServices/CoreServices.h> 28 #undef vector 29 #endif 24 30 #import <Foundation/Foundation.h> 25 31 26 32 #include "SDL_rwopsbundlesupport.h" -
src/filesystem/cocoa/SDL_sysfilesystem.m
diff -ru SDL2-2.0.3-orig/src/filesystem/cocoa/SDL_sysfilesystem.m SDL2-2.0.3/src/filesystem/cocoa/SDL_sysfilesystem.m
old new 25 25 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 26 26 /* System dependent filesystem routines */ 27 27 28 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 29 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 30 #define vector __vector 31 #include <CoreServices/CoreServices.h> 32 #undef vector 33 #endif 28 34 #include <Foundation/Foundation.h> 29 35 #include <sys/stat.h> 30 36 #include <sys/types.h> -
src/joystick/darwin/SDL_sysjoystick.c
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/power/macosx/SDL_syspower.c
diff -ru SDL2-2.0.3-orig/src/power/macosx/SDL_syspower.c SDL2-2.0.3/src/power/macosx/SDL_syspower.c
old new 23 23 #ifndef SDL_POWER_DISABLED 24 24 #if SDL_POWER_MACOSX 25 25 26 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 27 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 28 #define vector __vector 29 #include <CoreServices/CoreServices.h> 30 #undef vector 31 #endif 26 32 #include <Carbon/Carbon.h> 27 33 #include <IOKit/ps/IOPowerSources.h> 28 34 #include <IOKit/ps/IOPSKeys.h> -
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_cocoakeyboard.m
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoakeyboard.m SDL2-2.0.3/src/video/cocoa/SDL_cocoakeyboard.m
old new 426 426 static void 427 427 UpdateKeymap(SDL_VideoData *data) 428 428 { 429 #if defined(MAC_OS_X_VERSION_10_5) 429 430 TISInputSourceRef key_layout; 430 431 const void *chr_data; 431 432 int i; … … 483 484 484 485 cleanup: 485 486 CFRelease(key_layout); 487 #endif 486 488 } 487 489 488 490 void -
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_cocoamouse.h
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoamouse.h SDL2-2.0.3/src/video/cocoa/SDL_cocoamouse.h
old new 25 25 26 26 #include "SDL_cocoavideo.h" 27 27 28 #if !defined(MAC_OS_X_VERSION_10_5) 29 typedef float CGFloat; 30 #endif 31 28 32 extern void Cocoa_InitMouse(_THIS); 29 33 extern void Cocoa_HandleMouseEvent(_THIS, NSEvent * event); 30 34 extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent * event); -
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_cocoavideo.h
diff -ru SDL2-2.0.3-orig/src/video/cocoa/SDL_cocoavideo.h SDL2-2.0.3/src/video/cocoa/SDL_cocoavideo.h
old new 25 25 26 26 #include "SDL_opengl.h" 27 27 28 #if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5) 29 /* to cricumvent a bug in Mac OS X 10.4 SDK */ 30 #define vector __vector 31 #include <CoreServices/CoreServices.h> 32 #undef vector 33 #endif 28 34 #include <ApplicationServices/ApplicationServices.h> 29 35 #include <Cocoa/Cocoa.h> 30 36 … … 39 45 #include "SDL_cocoaopengl.h" 40 46 #include "SDL_cocoawindow.h" 41 47 48 #if !defined(MAC_OS_X_VERSION_10_5) 49 typedef long int NSInteger; 50 typedef unsigned int NSUInteger; 51 #endif 52 42 53 /* Private display data */ 43 54 44 55 @class SDLTranslatorResponder; -
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" … … 100 102 NSOpenGLContext *currentContext = [NSOpenGLContext currentContext]; 101 103 NSMutableArray *contexts = data->nscontexts; 102 104 @synchronized (contexts) { 105 #if defined(MAC_OS_X_VERSION_10_5) 103 106 for (SDLOpenGLContext *context in contexts) { 107 #else 108 /* old way to iterate */ 109 int i; 110 for (i = 0; i < [contexts count]; i++) { 111 SDLOpenGLContext *context = [contexts objectAtIndex:i]; 112 #endif 104 113 if (context == currentContext) { 105 114 [context update]; 106 115 } else { … … 190 199 [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window]; 191 200 [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window]; 192 201 [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window]; 202 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 193 203 [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window]; 194 204 [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window]; 195 205 [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window]; 196 206 [center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window]; 207 #endif 197 208 } else { 198 209 [window setDelegate:self]; 199 210 } … … 212 223 213 224 [view setNextResponder:self]; 214 225 226 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 215 227 if ([view respondsToSelector:@selector(setAcceptsTouchEvents:)]) { 216 228 [view setAcceptsTouchEvents:YES]; 217 229 } 230 #endif 218 231 } 219 232 220 233 - (void)observeValueForKeyPath:(NSString *)keyPath … … 282 295 inFullscreenTransition = YES; 283 296 284 297 /* you need to be FullScreenPrimary, or toggleFullScreen doesn't work. Unset it again in windowDidExitFullScreen. */ 298 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 285 299 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 300 #endif 286 301 [nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO]; 287 302 return YES; 288 303 } … … 319 334 [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window]; 320 335 [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window]; 321 336 [center removeObserver:self name:NSWindowDidResignKeyNotification object:window]; 337 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 322 338 [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window]; 323 339 [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window]; 324 340 [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window]; 325 341 [center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window]; 342 #endif 326 343 } else { 327 344 [window setDelegate:nil]; 328 345 } … … 346 363 !!! FIXME: http://bugzilla.libsdl.org/show_bug.cgi?id=1825 347 364 */ 348 365 windows = [NSApp orderedWindows]; 349 for (NSWindow *win in windows) 350 { 366 #if defined(MAC_OS_X_VERSION_10_5) 367 for (NSWindow *win in windows) { 368 #else 369 /* old way to iterate */ 370 int i; 371 for (i = 0; i < [windows count]; i++) { 372 NSWindow *win = [windows objectAtIndex:i]; 373 #endif 351 374 if (win == window) { 352 375 continue; 353 376 } … … 597 620 [nswindow miniaturize:nil]; 598 621 } else { 599 622 /* Adjust the fullscreen toggle button and readd menu now that we're here. */ 623 #if MAC_OS_X_VERSION_MIN_REQUIRED > 1070 600 624 if (window->flags & SDL_WINDOW_RESIZABLE) { 601 625 /* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */ 602 626 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 603 627 } else { 604 628 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorManaged]; 605 629 } 630 #endif 606 631 [NSMenu setMenuBarVisible:YES]; 607 632 608 633 pendingWindowOperation = PENDING_OPERATION_NONE; … … 620 645 } 621 646 } 622 647 648 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 623 649 -(NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions 624 650 { 625 651 if ((_data->window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) { … … 628 654 return proposedOptions; 629 655 } 630 656 } 657 #endif 631 658 632 659 633 660 /* We'll respond to key events by doing nothing so we don't beep. … … 822 849 [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent]; 823 850 } 824 851 852 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 825 853 - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event 826 854 { 827 855 NSSet *touches = 0; … … 875 903 touch = (NSTouch*)[enumerator nextObject]; 876 904 } 877 905 } 906 #endif 878 907 879 908 @end 880 909 … … 1040 1069 [nswindow setBackgroundColor:[NSColor blackColor]]; 1041 1070 1042 1071 if (videodata->allow_spaces) { 1072 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 1043 1073 SDL_assert(videodata->osversion >= 0x1070); 1044 1074 SDL_assert([nswindow respondsToSelector:@selector(toggleFullScreen:)]); 1045 1075 /* we put FULLSCREEN_DESKTOP windows in their own Space, without a toggle button or menubar, later */ … … 1047 1077 /* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */ 1048 1078 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; 1049 1079 } 1080 #endif 1050 1081 } 1051 1082 1052 1083 /* Create a default view for this window */ … … 1490 1521 } 1491 1522 1492 1523 NSArray *contexts = [[data->nscontexts copy] autorelease]; 1524 #if defined(MAC_OS_X_VERSION_10_5) 1493 1525 for (SDLOpenGLContext *context in contexts) { 1526 #else 1527 /* old way to iterate */ 1528 int i; 1529 for (i = 0; i < [contexts count]; i++) { 1530 SDLOpenGLContext *context = [contexts objectAtIndex:i]; 1531 #endif 1494 1532 /* Calling setWindow:NULL causes the context to remove itself from the context list. */ 1495 1533 [context setWindow:NULL]; 1496 1534 }