SDL_platform.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2010 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. #ifdef MAC_OS_X_VERSION_10_3
  70. #include "TargetConditionals.h" /* this header is in 10.3 or later */
  71. #if TARGET_OS_IPHONE
  72. /* if compiling for iPhone */
  73. #undef __IPHONEOS__
  74. #define __IPHONEOS__ 1
  75. #undef __MACOSX__
  76. #else
  77. /* if not compiling for iPhone */
  78. #undef __MACOSX__
  79. #define __MACOSX__ 1
  80. #endif /* TARGET_OS_IPHONE */
  81. #else
  82. /* if earlier verion of Mac OS X than version 10.3 */
  83. #undef __MACOSX__
  84. #define __MACOSX__ 1
  85. #endif
  86. #endif /* defined(__APPLE__) */
  87. #if defined(__NetBSD__)
  88. #undef __NETBSD__
  89. #define __NETBSD__ 1
  90. #endif
  91. #if defined(__OpenBSD__)
  92. #undef __OPENBSD__
  93. #define __OPENBSD__ 1
  94. #endif
  95. #if defined(__OS2__)
  96. #undef __OS2__
  97. #define __OS2__ 1
  98. #endif
  99. #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
  100. #undef __OSF__
  101. #define __OSF__ 1
  102. #endif
  103. #if defined(__QNXNTO__)
  104. #undef __QNXNTO__
  105. #define __QNXNTO__ 1
  106. #endif
  107. #if defined(riscos) || defined(__riscos) || defined(__riscos__)
  108. #undef __RISCOS__
  109. #define __RISCOS__ 1
  110. #endif
  111. #if defined(__SVR4)
  112. #undef __SOLARIS__
  113. #define __SOLARIS__ 1
  114. #endif
  115. #if defined(WIN32) || defined(_WIN32)
  116. #undef __WIN32__
  117. #define __WIN32__ 1
  118. #endif
  119. #if defined(__NDS__)
  120. #undef __NINTENDODS__
  121. #define __NINTENDODS__ 1
  122. #endif
  123. #include "begin_code.h"
  124. /* Set up for C function definitions, even when using C++ */
  125. #ifdef __cplusplus
  126. /* *INDENT-OFF* */
  127. extern "C" {
  128. /* *INDENT-ON* */
  129. #endif
  130. /**
  131. * \brief Gets the name of the platform.
  132. */
  133. extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
  134. /* Ends C function definitions when using C++ */
  135. #ifdef __cplusplus
  136. /* *INDENT-OFF* */
  137. }
  138. /* *INDENT-ON* */
  139. #endif
  140. #include "close_code.h"
  141. #endif /* _SDL_platform_h */
  142. /* vi: set ts=4 sw=4 expandtab: */