SDL_platform.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2011 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. Sam Lantinga
  16. [email protected]
  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(__BEOS__)
  30. #undef __BEOS__
  31. #define __BEOS__ 1
  32. #endif
  33. #if defined(__HAIKU__)
  34. #undef __HAIKU__
  35. #define __HAIKU__ 1
  36. #endif
  37. #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
  38. #undef __BSDI__
  39. #define __BSDI__ 1
  40. #endif
  41. #if defined(_arch_dreamcast)
  42. #undef __DREAMCAST__
  43. #define __DREAMCAST__ 1
  44. #endif
  45. #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
  46. #undef __FREEBSD__
  47. #define __FREEBSD__ 1
  48. #endif
  49. #if defined(hpux) || defined(__hpux) || defined(__hpux__)
  50. #undef __HPUX__
  51. #define __HPUX__ 1
  52. #endif
  53. #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
  54. #undef __IRIX__
  55. #define __IRIX__ 1
  56. #endif
  57. #if defined(linux) || defined(__linux) || defined(__linux__)
  58. #undef __LINUX__
  59. #define __LINUX__ 1
  60. #endif
  61. #if defined(ANDROID)
  62. #undef __ANDROID__
  63. #undef __LINUX__ /*do we need to do this?*/
  64. #define __ANDROID__ 1
  65. #endif
  66. #if defined(__APPLE__)
  67. /* lets us know what version of Mac OS X we're compiling on */
  68. #include "AvailabilityMacros.h"
  69. #include "TargetConditionals.h"
  70. #ifndef MAC_OS_X_VERSION_10_4
  71. #define MAC_OS_X_VERSION_10_4 1040
  72. #endif
  73. #ifndef MAC_OS_X_VERSION_10_5
  74. #define MAC_OS_X_VERSION_10_5 1050
  75. #endif
  76. #ifndef MAC_OS_X_VERSION_10_6
  77. #define MAC_OS_X_VERSION_10_6 1060
  78. #endif
  79. #if TARGET_OS_IPHONE
  80. /* if compiling for iPhone */
  81. #undef __IPHONEOS__
  82. #define __IPHONEOS__ 1
  83. #undef __MACOSX__
  84. #else
  85. /* if not compiling for iPhone */
  86. #undef __MACOSX__
  87. #define __MACOSX__ 1
  88. #endif /* TARGET_OS_IPHONE */
  89. #endif /* defined(__APPLE__) */
  90. #if defined(__NetBSD__)
  91. #undef __NETBSD__
  92. #define __NETBSD__ 1
  93. #endif
  94. #if defined(__OpenBSD__)
  95. #undef __OPENBSD__
  96. #define __OPENBSD__ 1
  97. #endif
  98. #if defined(__OS2__)
  99. #undef __OS2__
  100. #define __OS2__ 1
  101. #endif
  102. #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
  103. #undef __OSF__
  104. #define __OSF__ 1
  105. #endif
  106. #if defined(__QNXNTO__)
  107. #undef __QNXNTO__
  108. #define __QNXNTO__ 1
  109. #endif
  110. #if defined(riscos) || defined(__riscos) || defined(__riscos__)
  111. #undef __RISCOS__
  112. #define __RISCOS__ 1
  113. #endif
  114. #if defined(__SVR4)
  115. #undef __SOLARIS__
  116. #define __SOLARIS__ 1
  117. #endif
  118. #if defined(WIN32) || defined(_WIN32)
  119. #undef __WIN32__
  120. #define __WIN32__ 1
  121. #endif
  122. #if defined(__NDS__)
  123. #undef __NINTENDODS__
  124. #define __NINTENDODS__ 1
  125. #endif
  126. #include "begin_code.h"
  127. /* Set up for C function definitions, even when using C++ */
  128. #ifdef __cplusplus
  129. /* *INDENT-OFF* */
  130. extern "C" {
  131. /* *INDENT-ON* */
  132. #endif
  133. /**
  134. * \brief Gets the name of the platform.
  135. */
  136. extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
  137. /* Ends C function definitions when using C++ */
  138. #ifdef __cplusplus
  139. /* *INDENT-OFF* */
  140. }
  141. /* *INDENT-ON* */
  142. #endif
  143. #include "close_code.h"
  144. #endif /* _SDL_platform_h */
  145. /* vi: set ts=4 sw=4 expandtab: */