physfs_platforms.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 02 Nov 2008 15:19:58 -0500
changeset 942 e7bed87e50ce
parent 847 5e5e6c067413
child 947 b0c91495af9b
permissions -rw-r--r--
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.

#ifndef _INCL_PHYSFS_PLATFORMS
#define _INCL_PHYSFS_PLATFORMS

#ifndef __PHYSICSFS_INTERNAL__
#error Do not include this header from your applications.
#endif

/*
 * These only define the platforms to determine which files in the platforms
 *  directory should be compiled. For example, technically BeOS can be called
 *  a "unix" system, but since it doesn't use unix.c, we don't define
 *  PHYSFS_PLATFORM_UNIX on that system.
 */

#if ((defined __BEOS__) || (defined __beos__))
#  define PHYSFS_PLATFORM_BEOS
#  define PHYSFS_PLATFORM_POSIX
#elif (defined _WIN32_WCE) || (defined _WIN64_WCE)
#  define PHYSFS_PLATFORM_POCKETPC
#elif (((defined _WIN32) || (defined _WIN64)) && (!defined __CYGWIN__))
#  define PHYSFS_PLATFORM_WINDOWS
#elif (defined OS2)
#  define PHYSFS_PLATFORM_OS2
#elif ((defined __MACH__) && (defined __APPLE__))
/* 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)
#  define PHYSFS_PLATFORM_UNIX
#  define PHYSFS_PLATFORM_POSIX
#else
#  error Unknown platform.
#endif

#endif  /* include-once blocker. */