Commit 091cd521 authored by Sam Lantinga's avatar Sam Lantinga

Removed support for 10.3.9

Fixed building on Mac OS X 10.5
parent 7b8f9fe7
......@@ -74,8 +74,16 @@
#if defined(__APPLE__)
/* lets us know what version of Mac OS X we're compiling on */
#include "AvailabilityMacros.h"
#ifdef MAC_OS_X_VERSION_10_3
#include "TargetConditionals.h" /* this header is in 10.3 or later */
#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__
......@@ -86,12 +94,6 @@
#undef __MACOSX__
#define __MACOSX__ 1
#endif /* TARGET_OS_IPHONE */
#else
/* if earlier verion of Mac OS X than version 10.3 */
#undef __MACOSX__
#define __MACOSX__ 1
#endif
#endif /* defined(__APPLE__) */
#if defined(__NetBSD__)
......
......@@ -24,7 +24,7 @@
#include <CoreAudio/CoreAudio.h>
#include <CoreServices/CoreServices.h>
#include <AudioUnit/AudioUnit.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
#include <AudioUnit/AUNTComponent.h>
#endif
......
This diff is collapsed.
......@@ -39,11 +39,7 @@
/* The header was moved here in Mac OS X 10.1 */
#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
#include "10.3.9-FIX/IOHIDLib.h"
#else
#include <IOKit/hid/IOHIDLib.h>
#endif
#include <IOKit/hid/IOHIDKeys.h>
#include <CoreFoundation/CoreFoundation.h>
#include <Carbon/Carbon.h> /* for NewPtrClear, DisposePtr */
......
......@@ -24,11 +24,7 @@
#ifndef SDL_JOYSTICK_IOKIT_H
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
#include "10.3.9-FIX/IOHIDLib.h"
#else
#include <IOKit/hid/IOHIDLib.h>
#endif
#include <IOKit/hid/IOHIDKeys.h>
......
......@@ -27,9 +27,7 @@
static NSString *
GetTextFormat(_THIS)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
return NSStringPboardType;
#else
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
if (data->osversion >= 0x1060) {
......@@ -37,6 +35,8 @@ GetTextFormat(_THIS)
} else {
return NSStringPboardType;
}
#else
return NSStringPboardType;
#endif
}
......
......@@ -36,11 +36,9 @@
#endif
/* setAppleMenu disappeared from the headers in 10.4 */
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@interface NSApplication(NSAppleMenu)
- (void)setAppleMenu:(NSMenu *)menu;
@end
#endif
@implementation NSApplication(SDL)
- (void)setRunning
......
......@@ -171,7 +171,11 @@
}
/* 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
- (long) conversationIdentifier
#else
- (NSInteger) conversationIdentifier
#endif
{
return (long) self;
}
......@@ -478,7 +482,7 @@ HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags)
static void
UpdateKeymap(SDL_VideoData *data)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
TISInputSourceRef key_layout;
#else
KeyboardLayoutRef key_layout;
......@@ -489,7 +493,7 @@ UpdateKeymap(SDL_VideoData *data)
SDLKey keymap[SDL_NUM_SCANCODES];
/* See if the keymap needs to be updated */
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
key_layout = TISCopyCurrentKeyboardLayoutInputSource();
#else
KLGetCurrentKeyboardLayout(&key_layout);
......@@ -502,7 +506,7 @@ UpdateKeymap(SDL_VideoData *data)
SDL_GetDefaultKeymap(keymap);
/* Try Unicode data first (preferred as of Mac OS X 10.5) */
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
CFDataRef uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData);
if (uchrDataRef)
chr_data = CFDataGetBytePtr(uchrDataRef);
......@@ -544,7 +548,7 @@ UpdateKeymap(SDL_VideoData *data)
return;
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
cleanup:
CFRelease(key_layout);
#else
......
......@@ -23,7 +23,7 @@
#include "SDL_cocoavideo.h"
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
/*
Add methods to get at private members of NSScreen.
Since there is a bug in Apple's screen switching code
......@@ -290,7 +290,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
[[NSApp mainWindow] makeKeyAndOrderFront: nil];
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
/*
There is a bug in Cocoa where NSScreen doesn't synchronize
with CGDirectDisplay, so the main screen's frame is wrong.
......
......@@ -36,16 +36,6 @@
#define DEFAULT_OPENGL "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
/* This is implemented in Mac OS X 10.3 and above */
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
@implementation NSOpenGLContext(CGLContextAccess)
- (CGLContextObj)CGLContextObj;
{
return _contextAuxiliary;
}
@end
#endif /* < 10.3 */
int
Cocoa_GL_LoadLibrary(_THIS, const char *path)
{
......@@ -180,7 +170,7 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
#endif
{
long cache_max = 64;
GLint cache_max = 64;
CGLContextObj ctx = [context CGLContextObj];
CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max);
CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max);
......
......@@ -29,7 +29,9 @@ SDL_WindowShaper*
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
[windata->nswindow setStyleMask:NSBorderlessWindowMask];
#endif
SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper));
result->window = window;
result->mode.mode = ShapeModeDefault;
......
......@@ -40,7 +40,7 @@
#include "SDL_cocoaopengl.h"
#include "SDL_cocoawindow.h"
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
#if __LP64__
typedef long NSInteger;
typedef unsigned long NSUInteger;
......
......@@ -29,7 +29,7 @@
typedef struct SDL_WindowData SDL_WindowData;
/* *INDENT-OFF* */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
@interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
#else
@interface Cocoa_WindowListener : NSResponder {
......
......@@ -61,7 +61,9 @@ static __inline__ void ConvertNSRect(NSRect *r)
[center addObserver:self selector:@selector(windowDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp];
[_data->nswindow setAcceptsMouseMovedEvents:YES];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
[[_data->nswindow contentView] setAcceptsTouchEvents:YES];
#endif
}
- (void)close
......@@ -293,6 +295,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
NSSet *touches = 0;
NSEnumerator *enumerator;
NSTouch *touch;
......@@ -354,6 +357,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
touch = (NSTouch*)[enumerator nextObject];
}
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 */
}
@end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment