physfs_platforms.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef _INCL_PHYSFS_PLATFORMS
  2. #define _INCL_PHYSFS_PLATFORMS
  3. #ifndef __PHYSICSFS_INTERNAL__
  4. #error Do not include this header from your applications.
  5. #endif
  6. /*
  7. * These only define the platforms to determine which files in the platforms
  8. * directory should be compiled. For example, technically BeOS can be called
  9. * a "unix" system, but since it doesn't use unix.c, we don't define
  10. * PHYSFS_PLATFORM_UNIX on that system.
  11. */
  12. #if defined(TARGET_EXTENSION) && (defined(TARGET_PLAYDATE) || defined(TARGET_SIMULATOR))
  13. # define PHYSFS_PLATFORM_PLAYDATE 1
  14. # define PHYSFS_NO_CRUNTIME_MALLOC 1
  15. #elif (defined __LIBRETRO__)
  16. # define PHYSFS_PLATFORM_LIBRETRO 1
  17. #elif (defined __HAIKU__)
  18. # define PHYSFS_PLATFORM_HAIKU 1
  19. # define PHYSFS_PLATFORM_POSIX 1
  20. #elif ((defined __BEOS__) || (defined __beos__))
  21. # error BeOS support was dropped since PhysicsFS 2.1. Sorry. Try Haiku!
  22. #elif (defined _WIN32_WCE) || (defined _WIN64_WCE)
  23. # error PocketPC support was dropped since PhysicsFS 2.1. Sorry. Try WinRT!
  24. #elif (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */
  25. # include <winapifamily.h>
  26. # define PHYSFS_PLATFORM_WINDOWS 1
  27. # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  28. # define PHYSFS_NO_CDROM_SUPPORT 1
  29. # define PHYSFS_PLATFORM_WINRT 1
  30. # endif
  31. #elif (((defined _WIN32) || (defined _WIN64)) && (!defined __CYGWIN__))
  32. # define PHYSFS_PLATFORM_WINDOWS 1
  33. #elif defined(__OS2__) || defined(OS2)
  34. # define PHYSFS_PLATFORM_OS2 1
  35. #elif ((defined __MACH__) && (defined __APPLE__))
  36. /* To check if iOS or not, we need to include this file */
  37. # include <TargetConditionals.h>
  38. # if ((TARGET_IPHONE_SIMULATOR) || (TARGET_OS_IPHONE))
  39. # define PHYSFS_NO_CDROM_SUPPORT 1
  40. # endif
  41. # define PHYSFS_PLATFORM_APPLE 1
  42. # define PHYSFS_PLATFORM_POSIX 1
  43. #elif defined(macintosh)
  44. # error Classic Mac OS support was dropped from PhysicsFS 2.0. Move to OS X.
  45. #elif defined(__ANDROID__)
  46. # define PHYSFS_PLATFORM_LINUX 1
  47. # define PHYSFS_PLATFORM_ANDROID 1
  48. # define PHYSFS_PLATFORM_POSIX 1
  49. # define PHYSFS_NO_CDROM_SUPPORT 1
  50. #elif defined(__linux)
  51. # define PHYSFS_PLATFORM_LINUX 1
  52. # define PHYSFS_PLATFORM_UNIX 1
  53. # define PHYSFS_PLATFORM_POSIX 1
  54. #elif defined(__sun) || defined(sun)
  55. # define PHYSFS_PLATFORM_SOLARIS 1
  56. # define PHYSFS_PLATFORM_UNIX 1
  57. # define PHYSFS_PLATFORM_POSIX 1
  58. #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
  59. # define PHYSFS_PLATFORM_FREEBSD 1
  60. # define PHYSFS_PLATFORM_BSD 1
  61. # define PHYSFS_PLATFORM_UNIX 1
  62. # define PHYSFS_PLATFORM_POSIX 1
  63. #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
  64. # define PHYSFS_PLATFORM_BSD 1
  65. # define PHYSFS_PLATFORM_UNIX 1
  66. # define PHYSFS_PLATFORM_POSIX 1
  67. #elif defined(__EMSCRIPTEN__)
  68. # define PHYSFS_NO_CDROM_SUPPORT 1
  69. # define PHYSFS_PLATFORM_UNIX 1
  70. # define PHYSFS_PLATFORM_POSIX 1
  71. #elif defined(__QNX__)
  72. # define PHYSFS_PLATFORM_QNX 1
  73. # define PHYSFS_PLATFORM_POSIX 1
  74. #elif defined(unix) || defined(__unix__)
  75. # define PHYSFS_PLATFORM_UNIX 1
  76. # define PHYSFS_PLATFORM_POSIX 1
  77. #elif defined(__wii__) || defined(__gamecube__)
  78. # define PHYSFS_PLATFORM_OGC 1
  79. # define PHYSFS_NO_CDROM_SUPPORT 1 // TODO
  80. #else
  81. # error Unknown platform.
  82. #endif
  83. #endif /* include-once blocker. */