Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed the MAC_OS_X_VERSION_10_x macros from the 1.3 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 25, 2011
1 parent baab24f commit c985056
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 35 deletions.
9 changes: 0 additions & 9 deletions include/SDL_platform.h
Expand Up @@ -74,15 +74,6 @@
/* lets us know what version of Mac OS X we're compiling on */
#include "AvailabilityMacros.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 compiling for iPhone */
#undef __IPHONEOS__
Expand Down
2 changes: 1 addition & 1 deletion src/audio/coreaudio/SDL_coreaudio.h
Expand Up @@ -32,7 +32,7 @@
#if MACOSX_COREAUDIO
#include <CoreAudio/CoreAudio.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>
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoaclipboard.m
Expand Up @@ -26,7 +26,7 @@
static NSString *
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;

if (data->osversion >= 0x1060) {
Expand Down
10 changes: 5 additions & 5 deletions src/video/cocoa/SDL_cocoakeyboard.m
Expand Up @@ -170,7 +170,7 @@ - (NSAttributedString *) attributedSubstringFromRange: (NSRange) theRange
}

/* 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
#else
- (NSInteger) conversationIdentifier
Expand Down Expand Up @@ -481,7 +481,7 @@ - (NSArray *) validAttributesForMarkedText
static void
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;
#else
KeyboardLayoutRef key_layout;
Expand All @@ -492,7 +492,7 @@ - (NSArray *) validAttributesForMarkedText
SDL_Keycode keymap[SDL_NUM_SCANCODES];

/* 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();
#else
KLGetCurrentKeyboardLayout(&key_layout);
Expand All @@ -505,7 +505,7 @@ - (NSArray *) validAttributesForMarkedText
SDL_GetDefaultKeymap(keymap);

/* 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);
if (uchrDataRef)
chr_data = CFDataGetBytePtr(uchrDataRef);
Expand Down Expand Up @@ -547,7 +547,7 @@ - (NSArray *) validAttributesForMarkedText
return;
}

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
cleanup:
CFRelease(key_layout);
#else
Expand Down
26 changes: 13 additions & 13 deletions src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -27,10 +27,10 @@

#if FORCE_OLD_API
#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

#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.
Since there is a bug in Apple's screen switching code
Expand Down Expand Up @@ -122,7 +122,7 @@ - (void) setFrame:(NSRect)frame;
}
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)) {
CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef;
CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
Expand All @@ -144,7 +144,7 @@ - (void) setFrame:(NSRect)frame;
}
#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)) {
CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
Expand Down Expand Up @@ -181,7 +181,7 @@ - (void) setFrame:(NSRect)frame;
Cocoa_ReleaseDisplayMode(_THIS, const void *moderef)
{
/* 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)) {
CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */
}
Expand All @@ -192,7 +192,7 @@ - (void) setFrame:(NSRect)frame;
Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist)
{
/* 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)) {
CFRelease(modelist); /* NULL is ok */
}
Expand Down Expand Up @@ -242,13 +242,13 @@ - (void) setFrame:(NSRect)frame;
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)) {
moderef = CGDisplayCopyDisplayMode(displays[i]);
}
#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)) {
moderef = CGDisplayCurrentMode(displays[i]);
}
Expand Down Expand Up @@ -301,13 +301,13 @@ - (void) setFrame:(NSRect)frame;
SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
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)) {
modes = CGDisplayCopyAllDisplayModes(data->display, NULL);
}
#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)) {
modes = CGDisplayAvailableModes(data->display);
}
Expand All @@ -321,7 +321,7 @@ - (void) setFrame:(NSRect)frame;
const void *moderef = CFArrayGetValueAtIndex(modes, i);
SDL_DisplayMode 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)) {
CGDisplayModeRetain((CGDisplayModeRef) moderef);
}
Expand All @@ -337,13 +337,13 @@ - (void) setFrame:(NSRect)frame;
static CGError
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)) {
return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL);
}
#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)) {
return CGDisplaySwitchToMode(display, (CFDictionaryRef) mode);
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoashape.m
Expand Up @@ -28,7 +28,7 @@
Cocoa_CreateShaper(SDL_Window* window) {
SDL_WindowData* windata = (SDL_WindowData*)window->driverdata;
[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];
#endif
SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper));
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoavideo.h
Expand Up @@ -39,7 +39,7 @@
#include "SDL_cocoaopengl.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__
typedef long NSInteger;
typedef unsigned long NSUInteger;
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoawindow.h
Expand Up @@ -28,7 +28,7 @@
typedef struct SDL_WindowData SDL_WindowData;

/* *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> {
#else
@interface Cocoa_WindowListener : NSResponder {
Expand Down
6 changes: 3 additions & 3 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -67,7 +67,7 @@ - (void)listen:(SDL_WindowData *)data
[window setAcceptsMouseMovedEvents:YES];

[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];
#endif
}
Expand Down Expand Up @@ -380,7 +380,7 @@ - (void)touchesCancelledWithEvent:(NSEvent *) theEvent

- (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;
NSEnumerator *enumerator;
NSTouch *touch;
Expand Down Expand Up @@ -442,7 +442,7 @@ - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event

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
Expand Down

0 comments on commit c985056

Please sign in to comment.