changeset 4449:8f73f4a3c972

Exempted writable modes from bundle check on OS X since bundle areas are typically read-only.
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 08 May 2010 04:52:17 -0700
parents 2efcb52ba90a
children abd88bbaea2a
files src/file/cocoa/SDL_rwopsbundlesupport.m test/automated/rwops/Test_rwopsbundlesupport.m test/automated/rwops/rwops.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/file/cocoa/SDL_rwopsbundlesupport.m	Sat May 08 01:12:55 2010 -0700
+++ b/src/file/cocoa/SDL_rwopsbundlesupport.m	Sat May 08 04:52:17 2010 -0700
@@ -12,6 +12,12 @@
 {
     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];
 
 
--- a/test/automated/rwops/Test_rwopsbundlesupport.m	Sat May 08 01:12:55 2010 -0700
+++ b/test/automated/rwops/Test_rwopsbundlesupport.m	Sat May 08 04:52:17 2010 -0700
@@ -12,6 +12,12 @@
 {
     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];
 
 
--- a/test/automated/rwops/rwops.c	Sat May 08 01:12:55 2010 -0700
+++ b/test/automated/rwops/rwops.c	Sat May 08 04:52:17 2010 -0700
@@ -227,7 +227,6 @@
 
    /* Run read tests. */
 #if __APPLE__
-	/* Cheating: Using private API in SDL */
 	fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" );
 #else
    fp = fopen( RWOPS_READ, "r" );
@@ -243,7 +242,6 @@
 
    /* Run write tests. */
 #if __APPLE__
-	/* Cheating: Using private API in SDL */
 	fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" );
 #else
    fp = fopen( RWOPS_WRITE, "w+" );