diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-04 03:07:44 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-04 03:07:44 +0000 |
| commit | dd7da2fae96b9ba6bdbc28f7b26469373801f21e (patch) | |
| tree | 9faf6aa7f2fa2900dcabc3d88d11e87285693e9b /macosx/plugins/Common | |
| parent | a012af37d7bd3a972d2b3fbb7ed09bc8662e91eb (diff) | |
| download | pcsxr-dd7da2fae96b9ba6bdbc28f7b26469373801f21e.tar.gz | |
Make the plug-ins use ARC in 64-bit mode.
Change how the preprocessor macros are managed on OS X.
Set the name of the product to the target name.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85795 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/Common')
| -rw-r--r-- | macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m b/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m index 39b4c0e9..2f69bc9a 100644 --- a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -12,34 +12,31 @@ */ FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) { - FILE* fp = NULL; - - // If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. - if(strcmp("r", mode) && strcmp("rb", mode)) - { - return fopen(file, mode); - } - - NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; - - - NSFileManager* file_manager = [NSFileManager defaultManager]; - NSString* resource_path = [[NSBundle mainBundle] resourcePath]; - - NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; - - NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; - if([file_manager fileExistsAtPath:full_path_with_file_to_try]) - { - fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); - } - else - { - fp = fopen(file, mode); + @autoreleasepool { + FILE* fp = NULL; + + // If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. + if(strcmp("r", mode) && strcmp("rb", mode)) + { + return fopen(file, mode); + } + + NSFileManager* file_manager = [NSFileManager defaultManager]; + NSString* resource_path = [[NSBundle mainBundle] resourcePath]; + + NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; + + NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; + if([file_manager fileExistsAtPath:full_path_with_file_to_try]) + { + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); + } + else + { + fp = fopen(file, mode); + } + + return fp; } - - [autorelease_pool drain]; - - return fp; } #endif |
