iPhone support patch (thanks, Christian!)
authorRyan C. Gordon <icculus@icculus.org>
Sun, 02 Nov 2008 15:19:58 -0500
changeset 942 e7bed87e50ce
parent 941 788748c90925
child 943 5df593de06e2
iPhone support patch (thanks, Christian!) Original email... Date: Tue, 28 Oct 2008 20:22:04 +0100 From: Christian Gmeiner To: icculus@icculus.org Subject: Physfs IPhone suport Hi.. this simple patch adds IPhone support to physfs. I have also tested a normal osx 10 cocoa app and it builds too with this patch. Hope to see it soon in the main hg tree. In the next week I will do some tests on a real IPhone/IPod Touch, but I think it should be okay. greets, -- Christian Gmeiner, B.Sc.
CHANGELOG.txt
physfs_platforms.h
--- a/CHANGELOG.txt	Mon Jun 30 00:05:31 2008 +0000
+++ b/CHANGELOG.txt	Sun Nov 02 15:19:58 2008 -0500
@@ -2,6 +2,7 @@
  * CHANGELOG.
  */
 
+11022008 - iPhone support (thanks, Christian!)
 04032008 - Fixed PHYSFS_openAppend() to work as documented on Unix.
 03122008 - Fixed aliasing bug in Windows platform layer (thanks, Dennis!).
 03102008 - Changed some text files from ISO-8859-1 to UTF-8. Replaced all the
--- a/physfs_platforms.h	Mon Jun 30 00:05:31 2008 +0000
+++ b/physfs_platforms.h	Sun Nov 02 15:19:58 2008 -0500
@@ -22,8 +22,16 @@
 #elif (defined OS2)
 #  define PHYSFS_PLATFORM_OS2
 #elif ((defined __MACH__) && (defined __APPLE__))
-#  define PHYSFS_PLATFORM_MACOSX
-#  define PHYSFS_PLATFORM_POSIX
+/* To check if iphone or not, we need to inlcude this file */
+# include <TargetConditionals.h> 
+# if (defined(TARGET_IPHONE_SIMULATOR) || (defined TARGET_OS_IPHONE))
+#    define PHYSFS_PLATFORM_UNIX
+#    define PHYSFS_PLATFORM_POSIX
+#    define PHYSFS_NO_CDROM_SUPPORT
+#  else
+#    define PHYSFS_PLATFORM_MACOSX
+#    define PHYSFS_PLATFORM_POSIX
+#  endif
 #elif defined(macintosh)
 #  error Classic Mac OS support was dropped from PhysicsFS 2.0. Move to OS X.
 #elif defined(unix)