1.1 --- a/include/SDL_stdinc.h Tue Sep 22 02:42:11 2009 +0000
1.2 +++ b/include/SDL_stdinc.h Tue Sep 22 04:35:46 2009 +0000
1.3 @@ -78,6 +78,16 @@
1.4 #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
1.5 #define SDL_TABLESIZE(table) SDL_arraysize(table)
1.6
1.7 +/* Use proper C++ casts when compiled as C++ to be compatible with the option
1.8 + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
1.9 +#ifdef __cplusplus
1.10 +#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
1.11 +#define SDL_static_cast(type, expression) static_cast<type>(expression)
1.12 +#else
1.13 +#define SDL_reinterpret_cast(type, expression) ((type)(expression))
1.14 +#define SDL_static_cast(type, expression) ((type)(expression))
1.15 +#endif
1.16 +
1.17 /** @name Basic data types */
1.18 /*@{*/
1.19 typedef enum SDL_bool {