include/begin_code.h
changeset 7860 2b0bcdea3a79
parent 7771 4434498bf4b9
child 7872 ca36ab2a8179
equal deleted inserted replaced
7859:af63b63e7aac 7860:2b0bcdea3a79
    97 #else
    97 #else
    98 #pragma pack(push,4)
    98 #pragma pack(push,4)
    99 #endif
    99 #endif
   100 #endif /* Compiler needs structure packing set */
   100 #endif /* Compiler needs structure packing set */
   101 
   101 
   102 #ifndef __inline__
   102 #ifndef SDL_INLINE
   103 /* Set up compiler-specific options for inlining functions */
   103 /* Set up compiler-specific options for inlining functions */
   104 #ifndef SDL_INLINE_OKAY
       
   105 /* Add any special compiler-specific cases here */
       
   106 #if defined(_MSC_VER) || defined(__BORLANDC__) || \
   104 #if defined(_MSC_VER) || defined(__BORLANDC__) || \
   107     defined(__DMC__) || defined(__SC__) || \
   105     defined(__DMC__) || defined(__SC__) || \
   108     defined(__WATCOMC__) || defined(__LCC__) || \
   106     defined(__WATCOMC__) || defined(__LCC__) || \
   109     defined(__DECC)
   107     defined(__DECC)
   110 #ifndef __inline__
   108 #define SDL_INLINE  __inline
   111 #define __inline__  __inline
   109 #else
       
   110 #define SDL_INLINE inline
       
   111 #endif /* Visual C++ */
       
   112 #endif /* SDL_INLINE not defined */
       
   113 
       
   114 /* If inlining isn't supported, remove SDL_INLINE, turning static
       
   115    inlined functions into static functions (potentially resulting in
       
   116    code bloat in all files which include the offending header files)
       
   117 */
       
   118 #if __STRICT_ANSI__
       
   119 #undef SDL_INLINE
       
   120 #define SDL_INLINE
   112 #endif
   121 #endif
   113 #define SDL_INLINE_OKAY 1
       
   114 #else
       
   115 #if !defined(__MRC__) && !defined(_SGI_SOURCE)
       
   116 #ifndef __inline__
       
   117 #define __inline__ inline
       
   118 #endif
       
   119 #define SDL_INLINE_OKAY 1
       
   120 #endif /* Not a funky compiler */
       
   121 #endif /* Visual C++ */
       
   122 #endif /* SDL_INLINE_OKAY */
       
   123 
       
   124 /* If inlining isn't supported, remove "__inline__", turning static
       
   125    inlined functions into static functions (resulting in code bloat
       
   126    in all files which include the offending header files)
       
   127 */
       
   128 #if !SDL_INLINE_OKAY || __STRICT_ANSI__
       
   129 #ifdef __inline__
       
   130 #undef __inline__
       
   131 #endif
       
   132 #define __inline__
       
   133 #endif
       
   134 #endif /* __inline__ not defined */
       
   135 
   122 
   136 #ifndef SDL_FORCE_INLINE
   123 #ifndef SDL_FORCE_INLINE
   137 #if defined(_MSC_VER)
   124 #if defined(_MSC_VER)
   138 #define SDL_FORCE_INLINE __forceinline
   125 #define SDL_FORCE_INLINE __forceinline
   139 #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
   126 #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
   140 #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
   127 #define SDL_FORCE_INLINE __attribute__((always_inline)) static SDL_INLINE
   141 #else
   128 #else
   142 #define SDL_FORCE_INLINE static __inline__
   129 #define SDL_FORCE_INLINE static SDL_INLINE
   143 #endif
   130 #endif
   144 #endif
   131 #endif /* SDL_FORCE_INLINE not defined */
   145 
   132 
   146 /* Apparently this is needed by several Windows compilers */
   133 /* Apparently this is needed by several Windows compilers */
   147 #if !defined(__MACH__)
   134 #if !defined(__MACH__)
   148 #ifndef NULL
   135 #ifndef NULL
   149 #ifdef __cplusplus
   136 #ifdef __cplusplus