From d48c51f76c7b22a4806ba3f5c1c9ddc6a14eda24 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 22 Sep 2009 04:35:46 +0000 Subject: [PATCH] Added cast macros so SDL_net will compile with SDL 1.2 --- include/SDL_stdinc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 9f4fc85fb..ae553f736 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -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 {