SDL_platform.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <[email protected]>
  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. // Modified by Lasse Oorni for Urho3D
  19. /**
  20. * \file SDL_platform.h
  21. *
  22. * Try to get a standard set of platform defines.
  23. */
  24. #ifndef _SDL_platform_h
  25. #define _SDL_platform_h
  26. #if defined(_AIX)
  27. #undef __AIX__
  28. #define __AIX__ 1
  29. #endif
  30. #if defined(__HAIKU__)
  31. #undef __HAIKU__
  32. #define __HAIKU__ 1
  33. #endif
  34. #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
  35. #undef __BSDI__
  36. #define __BSDI__ 1
  37. #endif
  38. #if defined(_arch_dreamcast)
  39. #undef __DREAMCAST__
  40. #define __DREAMCAST__ 1
  41. #endif
  42. #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
  43. #undef __FREEBSD__
  44. #define __FREEBSD__ 1
  45. #endif
  46. #if defined(hpux) || defined(__hpux) || defined(__hpux__)
  47. #undef __HPUX__
  48. #define __HPUX__ 1
  49. #endif
  50. #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
  51. #undef __IRIX__
  52. #define __IRIX__ 1
  53. #endif
  54. #if defined(linux) || defined(__linux) || defined(__linux__)
  55. #undef __LINUX__
  56. #define __LINUX__ 1
  57. #endif
  58. #if defined(ANDROID) || defined(__ANDROID__)
  59. #undef __ANDROID__
  60. #undef __LINUX__ /* do we need to do this? */
  61. #define __ANDROID__ 1
  62. #endif
  63. #if defined(__APPLE__)
  64. /* lets us know what version of Mac OS X we're compiling on */
  65. #include "AvailabilityMacros.h"
  66. #include "TargetConditionals.h"
  67. #if TARGET_OS_IPHONE
  68. /* if compiling for iPhone */
  69. #undef __IPHONEOS__
  70. #define __IPHONEOS__ 1
  71. #undef __MACOSX__
  72. #else
  73. /* if not compiling for iPhone */
  74. #undef __MACOSX__
  75. #define __MACOSX__ 1
  76. #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
  77. # error SDL for Mac OS X only supports deploying on 10.5 and above.
  78. #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
  79. #endif /* TARGET_OS_IPHONE */
  80. #endif /* defined(__APPLE__) */
  81. #if defined(__NetBSD__)
  82. #undef __NETBSD__
  83. #define __NETBSD__ 1
  84. #endif
  85. #if defined(__OpenBSD__)
  86. #undef __OPENBSD__
  87. #define __OPENBSD__ 1
  88. #endif
  89. #if defined(__OS2__)
  90. #undef __OS2__
  91. #define __OS2__ 1
  92. #endif
  93. #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
  94. #undef __OSF__
  95. #define __OSF__ 1
  96. #endif
  97. #if defined(__QNXNTO__)
  98. #undef __QNXNTO__
  99. #define __QNXNTO__ 1
  100. #endif
  101. #if defined(riscos) || defined(__riscos) || defined(__riscos__)
  102. #undef __RISCOS__
  103. #define __RISCOS__ 1
  104. #endif
  105. #if defined(__SVR4)
  106. #undef __SOLARIS__
  107. #define __SOLARIS__ 1
  108. #endif
  109. #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
  110. /* Try to find out if we're compiling for WinRT or non-WinRT */
  111. /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
  112. // Urho3D: not all MinGW versions contain the winapifamily.h include file. Only check for WinRT
  113. // on Visual Studio
  114. #if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */
  115. #include <winapifamily.h>
  116. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  117. #undef __WINDOWS__
  118. #define __WINDOWS__ 1
  119. /* See if we're compiling for WinRT: */
  120. #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  121. #undef __WINRT__
  122. #define __WINRT__ 1
  123. #endif
  124. #else
  125. #undef __WINDOWS__
  126. #define __WINDOWS__ 1
  127. #endif /* _MSC_VER < 1700 */
  128. #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
  129. #if defined(__WINDOWS__)
  130. #undef __WIN32__
  131. #define __WIN32__ 1
  132. #endif
  133. #if defined(__PSP__)
  134. #undef __PSP__
  135. #define __PSP__ 1
  136. #endif
  137. #include "begin_code.h"
  138. /* Set up for C function definitions, even when using C++ */
  139. #ifdef __cplusplus
  140. extern "C" {
  141. #endif
  142. /**
  143. * \brief Gets the name of the platform.
  144. */
  145. extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
  146. /* Ends C function definitions when using C++ */
  147. #ifdef __cplusplus
  148. }
  149. #endif
  150. #include "close_code.h"
  151. #endif /* _SDL_platform_h */
  152. /* vi: set ts=4 sw=4 expandtab: */