begin_code.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifdef _begin_code_h
  2. #error Nested inclusion of begin_code.h
  3. #endif
  4. #define _begin_code_h
  5. #ifndef DECLSPEC
  6. # if defined(__BEOS__) || defined(__HAIKU__)
  7. # if defined(__GNUC__)
  8. # define DECLSPEC __declspec(dllexport)
  9. # else
  10. # define DECLSPEC __declspec(export)
  11. # endif
  12. # elif defined(__WIN32__)
  13. # ifdef __BORLANDC__
  14. # ifdef BUILD_SDL
  15. # define DECLSPEC
  16. # else
  17. # define DECLSPEC __declspec(dllimport)
  18. # endif
  19. # else
  20. # define DECLSPEC __declspec(dllexport)
  21. # endif
  22. # else
  23. # if defined(__GNUC__) && __GNUC__ >= 4
  24. # define DECLSPEC __attribute__ ((visibility("default")))
  25. # else
  26. # define DECLSPEC
  27. # endif
  28. # endif
  29. #endif
  30. #ifndef SDLCALL
  31. #if defined(__WIN32__) && !defined(__GNUC__)
  32. #define SDLCALL __cdecl
  33. #else
  34. #define SDLCALL
  35. #endif
  36. #endif
  37. #ifdef __SYMBIAN32__
  38. #undef DECLSPEC
  39. #define DECLSPEC
  40. #endif
  41. #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
  42. #ifdef _MSC_VER
  43. #pragma warning(disable: 4103)
  44. #endif
  45. #ifdef __BORLANDC__
  46. #pragma nopackwarning
  47. #endif
  48. #ifdef _M_X64
  49. #pragma pack(push,8)
  50. #else
  51. #pragma pack(push,4)
  52. #endif
  53. #endif
  54. #ifndef SDL_INLINE_OKAY
  55. #ifdef __GNUC__
  56. #define SDL_INLINE_OKAY
  57. #else
  58. #if defined(_MSC_VER) || defined(__BORLANDC__) || \
  59. defined(__DMC__) || defined(__SC__) || \
  60. defined(__WATCOMC__) || defined(__LCC__) || \
  61. defined(__DECC)
  62. #ifndef __inline__
  63. #define __inline__ __inline
  64. #endif
  65. #define SDL_INLINE_OKAY
  66. #else
  67. #if !defined(__MRC__) && !defined(_SGI_SOURCE)
  68. #ifndef __inline__
  69. #define __inline__ inline
  70. #endif
  71. #define SDL_INLINE_OKAY
  72. #endif
  73. #endif
  74. #endif
  75. #endif
  76. #ifndef SDL_INLINE_OKAY
  77. #define __inline__
  78. #endif
  79. #ifndef SDL_FORCE_INLINE
  80. #if defined(_MSC_VER)
  81. #define SDL_FORCE_INLINE __forceinline
  82. #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
  83. #define SDL_FORCE_INLINE __attribute__((always_inline)) static inline
  84. #else
  85. #define SDL_FORCE_INLINE static __inline__
  86. #endif
  87. #endif
  88. #if !defined(__MACH__)
  89. #ifndef NULL
  90. #ifdef __cplusplus
  91. #define NULL 0
  92. #else
  93. #define NULL ((void *)0)
  94. #endif
  95. #endif
  96. #endif