# HG changeset patch # User Sam Lantinga # Date 1253594146 0 # Node ID 48e63c07bbbf0cd70107ac31cdf4f1ff064039a3 # Parent 29605c881b2999a6dd65944cf5c14043ae4c8e4f Added cast macros so SDL_net will compile with SDL 1.2 diff -r 29605c881b29 -r 48e63c07bbbf include/SDL_stdinc.h --- a/include/SDL_stdinc.h Tue Sep 22 02:42:11 2009 +0000 +++ b/include/SDL_stdinc.h Tue Sep 22 04:35:46 2009 +0000 @@ -78,6 +78,16 @@ #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) #define SDL_TABLESIZE(table) SDL_arraysize(table) +/* Use proper C++ casts when compiled as C++ to be compatible with the option + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif + /** @name Basic data types */ /*@{*/ typedef enum SDL_bool {