🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

235 lines
5.9 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_platform.h
  20. *
  21. * Try to get a standard set of platform defines.
  22. */
  23. #ifndef SDL_platform_h_
  24. #define SDL_platform_h_
  25. #if defined(_AIX)
  26. #undef __AIX__
  27. #define __AIX__ 1
  28. #endif
  29. #if defined(__HAIKU__)
  30. #undef __HAIKU__
  31. #define __HAIKU__ 1
  32. #endif
  33. #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
  34. #undef __BSDI__
  35. #define __BSDI__ 1
  36. #endif
  37. #if defined(_arch_dreamcast)
  38. #undef __DREAMCAST__
  39. #define __DREAMCAST__ 1
  40. #endif
  41. #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
  42. #undef __FREEBSD__
  43. #define __FREEBSD__ 1
  44. #endif
  45. #if defined(hpux) || defined(__hpux) || defined(__hpux__)
  46. #undef __HPUX__
  47. #define __HPUX__ 1
  48. #endif
  49. #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
  50. #undef __IRIX__
  51. #define __IRIX__ 1
  52. #endif
  53. #if (defined(linux) || defined(__linux) || defined(__linux__))
  54. #undef __LINUX__
  55. #define __LINUX__ 1
  56. #endif
  57. #if defined(ANDROID) || defined(__ANDROID__)
  58. #undef __ANDROID__
  59. #undef __LINUX__ /* do we need to do this? */
  60. #define __ANDROID__ 1
  61. #endif
  62. #if defined(__APPLE__)
  63. /* lets us know what version of Mac OS X we're compiling on */
  64. #include "AvailabilityMacros.h"
  65. #include "TargetConditionals.h"
  66. /* Fix building with older SDKs that don't define these
  67. See this for more information:
  68. https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets
  69. */
  70. #ifndef TARGET_OS_MACCATALYST
  71. #define TARGET_OS_MACCATALYST 0
  72. #endif
  73. #ifndef TARGET_OS_IOS
  74. #define TARGET_OS_IOS 0
  75. #endif
  76. #ifndef TARGET_OS_IPHONE
  77. #define TARGET_OS_IPHONE 0
  78. #endif
  79. #ifndef TARGET_OS_TV
  80. #define TARGET_OS_TV 0
  81. #endif
  82. #ifndef TARGET_OS_SIMULATOR
  83. #define TARGET_OS_SIMULATOR 0
  84. #endif
  85. #if TARGET_OS_TV
  86. #undef __TVOS__
  87. #define __TVOS__ 1
  88. #endif
  89. #if TARGET_OS_IPHONE
  90. /* if compiling for iOS */
  91. #undef __IPHONEOS__
  92. #define __IPHONEOS__ 1
  93. #undef __MACOSX__
  94. #else
  95. /* if not compiling for iOS */
  96. #undef __MACOSX__
  97. #define __MACOSX__ 1
  98. #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
  99. # error SDL for Mac OS X only supports deploying on 10.6 and above.
  100. #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
  101. #endif /* TARGET_OS_IPHONE */
  102. #endif /* defined(__APPLE__) */
  103. #if defined(__NetBSD__)
  104. #undef __NETBSD__
  105. #define __NETBSD__ 1
  106. #endif
  107. #if defined(__OpenBSD__)
  108. #undef __OPENBSD__
  109. #define __OPENBSD__ 1
  110. #endif
  111. #if defined(__OS2__) || defined(__EMX__)
  112. #undef __OS2__
  113. #define __OS2__ 1
  114. #endif
  115. #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
  116. #undef __OSF__
  117. #define __OSF__ 1
  118. #endif
  119. #if defined(__QNXNTO__)
  120. #undef __QNXNTO__
  121. #define __QNXNTO__ 1
  122. #endif
  123. #if defined(riscos) || defined(__riscos) || defined(__riscos__)
  124. #undef __RISCOS__
  125. #define __RISCOS__ 1
  126. #endif
  127. #if defined(__sun) && defined(__SVR4)
  128. #undef __SOLARIS__
  129. #define __SOLARIS__ 1
  130. #endif
  131. #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
  132. /* Try to find out if we're compiling for WinRT or non-WinRT */
  133. #if defined(_MSC_VER) && defined(__has_include)
  134. #if __has_include(<winapifamily.h>)
  135. #define HAVE_WINAPIFAMILY_H 1
  136. #else
  137. #define HAVE_WINAPIFAMILY_H 0
  138. #endif
  139. /* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
  140. #elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */
  141. #define HAVE_WINAPIFAMILY_H 1
  142. #else
  143. #define HAVE_WINAPIFAMILY_H 0
  144. #endif
  145. #if HAVE_WINAPIFAMILY_H
  146. #include <winapifamily.h>
  147. #define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
  148. #else
  149. #define WINAPI_FAMILY_WINRT 0
  150. #endif /* HAVE_WINAPIFAMILY_H */
  151. #if WINAPI_FAMILY_WINRT
  152. #undef __WINRT__
  153. #define __WINRT__ 1
  154. #else
  155. #undef __WINDOWS__
  156. #define __WINDOWS__ 1
  157. #endif
  158. #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
  159. #if defined(__WINDOWS__)
  160. #undef __WIN32__
  161. #define __WIN32__ 1
  162. #endif
  163. #if defined(__PSP__)
  164. #undef __PSP__
  165. #define __PSP__ 1
  166. #endif
  167. /* The NACL compiler defines __native_client__ and __pnacl__
  168. * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
  169. */
  170. #if defined(__native_client__)
  171. #undef __LINUX__
  172. #undef __NACL__
  173. #define __NACL__ 1
  174. #endif
  175. #if defined(__pnacl__)
  176. #undef __LINUX__
  177. #undef __PNACL__
  178. #define __PNACL__ 1
  179. /* PNACL with newlib supports static linking only */
  180. #define __SDL_NOGETPROCADDR__
  181. #endif
  182. #if defined(__vita__)
  183. #define __VITA__ 1
  184. #endif
  185. #include "begin_code.h"
  186. /* Set up for C function definitions, even when using C++ */
  187. #ifdef __cplusplus
  188. extern "C" {
  189. #endif
  190. /**
  191. * Get the name of the platform.
  192. *
  193. * Here are the names returned for some (but not all) supported platforms:
  194. *
  195. * - "Windows"
  196. * - "Mac OS X"
  197. * - "Linux"
  198. * - "iOS"
  199. * - "Android"
  200. *
  201. * \returns the name of the platform. If the correct platform name is not
  202. * available, returns a string beginning with the text "Unknown".
  203. *
  204. * \since This function is available since SDL 2.0.0.
  205. */
  206. extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
  207. /* Ends C function definitions when using C++ */
  208. #ifdef __cplusplus
  209. }
  210. #endif
  211. #include "close_code.h"
  212. #endif /* SDL_platform_h_ */
  213. /* vi: set ts=4 sw=4 expandtab: */