Removed the MAC_OS_X_VERSION_10_x macros from the 1.3 branch.
This commit is contained in:
parent
c3366d1756
commit
0daed19a0e
9 changed files with 26 additions and 35 deletions
|
@ -74,15 +74,6 @@
|
||||||
/* lets us know what version of Mac OS X we're compiling on */
|
/* lets us know what version of Mac OS X we're compiling on */
|
||||||
#include "AvailabilityMacros.h"
|
#include "AvailabilityMacros.h"
|
||||||
#include "TargetConditionals.h"
|
#include "TargetConditionals.h"
|
||||||
#ifndef MAC_OS_X_VERSION_10_4
|
|
||||||
#define MAC_OS_X_VERSION_10_4 1040
|
|
||||||
#endif
|
|
||||||
#ifndef MAC_OS_X_VERSION_10_5
|
|
||||||
#define MAC_OS_X_VERSION_10_5 1050
|
|
||||||
#endif
|
|
||||||
#ifndef MAC_OS_X_VERSION_10_6
|
|
||||||
#define MAC_OS_X_VERSION_10_6 1060
|
|
||||||
#endif
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
/* if compiling for iPhone */
|
/* if compiling for iPhone */
|
||||||
#undef __IPHONEOS__
|
#undef __IPHONEOS__
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#if MACOSX_COREAUDIO
|
#if MACOSX_COREAUDIO
|
||||||
#include <CoreAudio/CoreAudio.h>
|
#include <CoreAudio/CoreAudio.h>
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050
|
||||||
#include <AudioUnit/AUNTComponent.h>
|
#include <AudioUnit/AUNTComponent.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
static NSString *
|
static NSString *
|
||||||
GetTextFormat(_THIS)
|
GetTextFormat(_THIS)
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||||
|
|
||||||
if (data->osversion >= 0x1060) {
|
if (data->osversion >= 0x1060) {
|
||||||
|
|
|
@ -170,7 +170,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Needs long instead of NSInteger for compilation on Mac OS X 10.4 */
|
/* Needs long instead of NSInteger for compilation on Mac OS X 10.4 */
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||||
- (long) conversationIdentifier
|
- (long) conversationIdentifier
|
||||||
#else
|
#else
|
||||||
- (NSInteger) conversationIdentifier
|
- (NSInteger) conversationIdentifier
|
||||||
|
@ -481,7 +481,7 @@ HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags)
|
||||||
static void
|
static void
|
||||||
UpdateKeymap(SDL_VideoData *data)
|
UpdateKeymap(SDL_VideoData *data)
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||||
TISInputSourceRef key_layout;
|
TISInputSourceRef key_layout;
|
||||||
#else
|
#else
|
||||||
KeyboardLayoutRef key_layout;
|
KeyboardLayoutRef key_layout;
|
||||||
|
@ -492,7 +492,7 @@ UpdateKeymap(SDL_VideoData *data)
|
||||||
SDL_Keycode keymap[SDL_NUM_SCANCODES];
|
SDL_Keycode keymap[SDL_NUM_SCANCODES];
|
||||||
|
|
||||||
/* See if the keymap needs to be updated */
|
/* See if the keymap needs to be updated */
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||||
key_layout = TISCopyCurrentKeyboardLayoutInputSource();
|
key_layout = TISCopyCurrentKeyboardLayoutInputSource();
|
||||||
#else
|
#else
|
||||||
KLGetCurrentKeyboardLayout(&key_layout);
|
KLGetCurrentKeyboardLayout(&key_layout);
|
||||||
|
@ -505,7 +505,7 @@ UpdateKeymap(SDL_VideoData *data)
|
||||||
SDL_GetDefaultKeymap(keymap);
|
SDL_GetDefaultKeymap(keymap);
|
||||||
|
|
||||||
/* Try Unicode data first (preferred as of Mac OS X 10.5) */
|
/* Try Unicode data first (preferred as of Mac OS X 10.5) */
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||||
CFDataRef uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData);
|
CFDataRef uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData);
|
||||||
if (uchrDataRef)
|
if (uchrDataRef)
|
||||||
chr_data = CFDataGetBytePtr(uchrDataRef);
|
chr_data = CFDataGetBytePtr(uchrDataRef);
|
||||||
|
@ -547,7 +547,7 @@ UpdateKeymap(SDL_VideoData *data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||||
cleanup:
|
cleanup:
|
||||||
CFRelease(key_layout);
|
CFRelease(key_layout);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
|
|
||||||
#if FORCE_OLD_API
|
#if FORCE_OLD_API
|
||||||
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
#undef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5
|
#define MAC_OS_X_VERSION_MIN_REQUIRED 1050
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||||
/*
|
/*
|
||||||
Add methods to get at private members of NSScreen.
|
Add methods to get at private members of NSScreen.
|
||||||
Since there is a bug in Apple's screen switching code
|
Since there is a bug in Apple's screen switching code
|
||||||
|
@ -122,7 +122,7 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
|
||||||
}
|
}
|
||||||
data->moderef = moderef;
|
data->moderef = moderef;
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef;
|
CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef;
|
||||||
CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
|
CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
|
||||||
|
@ -144,7 +144,7 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
|
CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
|
||||||
number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
|
number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
|
||||||
|
@ -181,7 +181,7 @@ static inline void
|
||||||
Cocoa_ReleaseDisplayMode(_THIS, const void *moderef)
|
Cocoa_ReleaseDisplayMode(_THIS, const void *moderef)
|
||||||
{
|
{
|
||||||
/* We don't own moderef unless we use the 10.6+ APIs. */
|
/* We don't own moderef unless we use the 10.6+ APIs. */
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */
|
CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ static inline void
|
||||||
Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist)
|
Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist)
|
||||||
{
|
{
|
||||||
/* We don't own modelis unless we use the 10.6+ APIs. */
|
/* We don't own modelis unless we use the 10.6+ APIs. */
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
CFRelease(modelist); /* NULL is ok */
|
CFRelease(modelist); /* NULL is ok */
|
||||||
}
|
}
|
||||||
|
@ -242,13 +242,13 @@ Cocoa_InitModes(_THIS)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
moderef = CGDisplayCopyDisplayMode(displays[i]);
|
moderef = CGDisplayCopyDisplayMode(displays[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
moderef = CGDisplayCurrentMode(displays[i]);
|
moderef = CGDisplayCurrentMode(displays[i]);
|
||||||
}
|
}
|
||||||
|
@ -301,13 +301,13 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
|
||||||
SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
|
SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
|
||||||
CFArrayRef modes = NULL;
|
CFArrayRef modes = NULL;
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
modes = CGDisplayCopyAllDisplayModes(data->display, NULL);
|
modes = CGDisplayCopyAllDisplayModes(data->display, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
modes = CGDisplayAvailableModes(data->display);
|
modes = CGDisplayAvailableModes(data->display);
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
|
||||||
const void *moderef = CFArrayGetValueAtIndex(modes, i);
|
const void *moderef = CFArrayGetValueAtIndex(modes, i);
|
||||||
SDL_DisplayMode mode;
|
SDL_DisplayMode mode;
|
||||||
if (GetDisplayMode(_this, moderef, &mode)) {
|
if (GetDisplayMode(_this, moderef, &mode)) {
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
CGDisplayModeRetain((CGDisplayModeRef) moderef);
|
CGDisplayModeRetain((CGDisplayModeRef) moderef);
|
||||||
}
|
}
|
||||||
|
@ -337,13 +337,13 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
|
||||||
static CGError
|
static CGError
|
||||||
Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode)
|
Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode)
|
||||||
{
|
{
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL);
|
return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||||
return CGDisplaySwitchToMode(display, (CFDictionaryRef) mode);
|
return CGDisplaySwitchToMode(display, (CFDictionaryRef) mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ SDL_WindowShaper*
|
||||||
Cocoa_CreateShaper(SDL_Window* window) {
|
Cocoa_CreateShaper(SDL_Window* window) {
|
||||||
SDL_WindowData* windata = (SDL_WindowData*)window->driverdata;
|
SDL_WindowData* windata = (SDL_WindowData*)window->driverdata;
|
||||||
[windata->nswindow setOpaque:NO];
|
[windata->nswindow setOpaque:NO];
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||||
[windata->nswindow setStyleMask:NSBorderlessWindowMask];
|
[windata->nswindow setStyleMask:NSBorderlessWindowMask];
|
||||||
#endif
|
#endif
|
||||||
SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper));
|
SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper));
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "SDL_cocoaopengl.h"
|
#include "SDL_cocoaopengl.h"
|
||||||
#include "SDL_cocoawindow.h"
|
#include "SDL_cocoawindow.h"
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||||
#if __LP64__
|
#if __LP64__
|
||||||
typedef long NSInteger;
|
typedef long NSInteger;
|
||||||
typedef unsigned long NSUInteger;
|
typedef unsigned long NSUInteger;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
typedef struct SDL_WindowData SDL_WindowData;
|
typedef struct SDL_WindowData SDL_WindowData;
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||||
@interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
|
@interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
|
||||||
#else
|
#else
|
||||||
@interface Cocoa_WindowListener : NSResponder {
|
@interface Cocoa_WindowListener : NSResponder {
|
||||||
|
|
|
@ -67,7 +67,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
[window setAcceptsMouseMovedEvents:YES];
|
[window setAcceptsMouseMovedEvents:YES];
|
||||||
|
|
||||||
[view setNextResponder:self];
|
[view setNextResponder:self];
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
[view setAcceptsTouchEvents:YES];
|
[view setAcceptsTouchEvents:YES];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
|
|
||||||
- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
|
- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
|
||||||
{
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||||
NSSet *touches = 0;
|
NSSet *touches = 0;
|
||||||
NSEnumerator *enumerator;
|
NSEnumerator *enumerator;
|
||||||
NSTouch *touch;
|
NSTouch *touch;
|
||||||
|
@ -442,7 +442,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
|
|
||||||
touch = (NSTouch*)[enumerator nextObject];
|
touch = (NSTouch*)[enumerator nextObject];
|
||||||
}
|
}
|
||||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 */
|
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue