comparison include/SDL_stdinc.h @ 4233:48e63c07bbbf SDL-1.2

Added cast macros so SDL_net will compile with SDL 1.2
author Sam Lantinga <slouken@libsdl.org>
date Tue, 22 Sep 2009 04:35:46 +0000
parents 6637846f3f7f
children cd511a8560b7
comparison
equal deleted inserted replaced
4232:29605c881b29 4233:48e63c07bbbf
75 #endif 75 #endif
76 76
77 /** The number of elements in an array */ 77 /** The number of elements in an array */
78 #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) 78 #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
79 #define SDL_TABLESIZE(table) SDL_arraysize(table) 79 #define SDL_TABLESIZE(table) SDL_arraysize(table)
80
81 /* Use proper C++ casts when compiled as C++ to be compatible with the option
82 -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
83 #ifdef __cplusplus
84 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
85 #define SDL_static_cast(type, expression) static_cast<type>(expression)
86 #else
87 #define SDL_reinterpret_cast(type, expression) ((type)(expression))
88 #define SDL_static_cast(type, expression) ((type)(expression))
89 #endif
80 90
81 /** @name Basic data types */ 91 /** @name Basic data types */
82 /*@{*/ 92 /*@{*/
83 typedef enum SDL_bool { 93 typedef enum SDL_bool {
84 SDL_FALSE = 0, 94 SDL_FALSE = 0,