include/SDL_stdinc.h
changeset 8535 e8ee0708ef5c
parent 8500 f25ef28d61e8
parent 7678 286c42d7c5ed
child 8543 b9dd3cf38585
equal deleted inserted replaced
8534:50177f518fdb 8535:e8ee0708ef5c
    97  *  \name Cast operators
    97  *  \name Cast operators
    98  *
    98  *
    99  *  Use proper C++ casts when compiled as C++ to be compatible with the option
    99  *  Use proper C++ casts when compiled as C++ to be compatible with the option
   100  *  -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
   100  *  -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
   101  */
   101  */
   102 /*@{*/
   102 /* @{ */
   103 #ifdef __cplusplus
   103 #ifdef __cplusplus
   104 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
   104 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
   105 #define SDL_static_cast(type, expression) static_cast<type>(expression)
   105 #define SDL_static_cast(type, expression) static_cast<type>(expression)
   106 #define SDL_const_cast(type, expression) const_cast<type>(expression)
   106 #define SDL_const_cast(type, expression) const_cast<type>(expression)
   107 #else
   107 #else
   108 #define SDL_reinterpret_cast(type, expression) ((type)(expression))
   108 #define SDL_reinterpret_cast(type, expression) ((type)(expression))
   109 #define SDL_static_cast(type, expression) ((type)(expression))
   109 #define SDL_static_cast(type, expression) ((type)(expression))
   110 #define SDL_const_cast(type, expression) ((type)(expression))
   110 #define SDL_const_cast(type, expression) ((type)(expression))
   111 #endif
   111 #endif
   112 /*@}*//*Cast operators*/
   112 /* @} *//* Cast operators */
   113 
   113 
   114 /* Define a four character code as a Uint32 */
   114 /* Define a four character code as a Uint32 */
   115 #define SDL_FOURCC(A, B, C, D) \
   115 #define SDL_FOURCC(A, B, C, D) \
   116     ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
   116     ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
   117      (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
   117      (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
   119      (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
   119      (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
   120 
   120 
   121 /**
   121 /**
   122  *  \name Basic data types
   122  *  \name Basic data types
   123  */
   123  */
   124 /*@{*/
   124 /* @{ */
   125 
   125 
   126 typedef enum
   126 typedef enum
   127 {
   127 {
   128     SDL_FALSE = 0,
   128     SDL_FALSE = 0,
   129     SDL_TRUE = 1
   129     SDL_TRUE = 1
   161 /**
   161 /**
   162  * \brief An unsigned 64-bit integer type.
   162  * \brief An unsigned 64-bit integer type.
   163  */
   163  */
   164 typedef uint64_t Uint64;
   164 typedef uint64_t Uint64;
   165 
   165 
   166 /*@}*//*Basic data types*/
   166 /* @} *//* Basic data types */
   167 
   167 
   168 
   168 
   169 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
   169 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
   170        typedef int SDL_dummy_ ## name[(x) * 2 - 1]
   170        typedef int SDL_dummy_ ## name[(x) * 2 - 1]
   171 /** \cond */
   171 /** \cond */