Skip to content

Commit

Permalink
Added cast macros so SDL_net will compile with SDL 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 22, 2009
1 parent 9638312 commit d48c51f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/SDL_stdinc.h
Expand Up @@ -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<type>(expression)
#define SDL_static_cast(type, expression) static_cast<type>(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 {
Expand Down

0 comments on commit d48c51f

Please sign in to comment.