Mercurial > sdl-ios-xcode
comparison src/main/macosx/SDLMain.m @ 1591:24247fe40188
Close off warning about setAppleMenu on Mac OS X 10.4 SDK.
Fixes Bugzilla #97.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 22 Mar 2006 22:33:23 +0000 |
parents | 3a8920cc822b |
children | 14717b52abc0 |
comparison
equal
deleted
inserted
replaced
1590:96d8c3fec479 | 1591:24247fe40188 |
---|---|
7 | 7 |
8 #import "SDL.h" | 8 #import "SDL.h" |
9 #import "SDLMain.h" | 9 #import "SDLMain.h" |
10 #import <sys/param.h> /* for MAXPATHLEN */ | 10 #import <sys/param.h> /* for MAXPATHLEN */ |
11 #import <unistd.h> | 11 #import <unistd.h> |
12 | |
13 /* For some reaon, Apple removed setAppleMenu from the headers in 10.4, | |
14 but the method still is there and works. To avoid warnings, we declare | |
15 it ourselves here. */ | |
16 @interface NSApplication(SDL_Missing_Methods) | |
17 - (void)setAppleMenu:(NSMenu *)menu; | |
18 @end | |
12 | 19 |
13 /* Use this flag to determine whether we use SDLMain.nib or not */ | 20 /* Use this flag to determine whether we use SDLMain.nib or not */ |
14 #define SDL_USE_NIB_FILE 0 | 21 #define SDL_USE_NIB_FILE 0 |
15 | 22 |
16 /* Use this flag to determine whether we use CPS (docking) or not */ | 23 /* Use this flag to determine whether we use CPS (docking) or not */ |
80 if (shouldChdir) | 87 if (shouldChdir) |
81 { | 88 { |
82 char parentdir[MAXPATHLEN]; | 89 char parentdir[MAXPATHLEN]; |
83 CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); | 90 CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); |
84 CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); | 91 CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); |
85 if (CFURLGetFileSystemRepresentation(url2, true, parentdir, MAXPATHLEN)) { | 92 if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { |
86 assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ | 93 assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ |
87 } | 94 } |
88 CFRelease(url); | 95 CFRelease(url); |
89 CFRelease(url2); | 96 CFRelease(url2); |
90 } | 97 } |