Commit dfa643c3 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #176

[I'm fixing this for the public headers, but I'm not going to bother for the SDL library code (yet)]

To clarify: Normaly, GCC (or, to be precise, the preprocessor) will ignore
this, and compile the code happily. However, one can specify -Wundef to get a
warning about this.

One can probably argue whether to consider this a bug or not; but I think that
(a) from a semantic point of view, using "#if FOO" when FOO is not defined is
strange, and (b) since it is possible to trigger a warning about this, and a
trivial fix exists, it should be corrected.

I can think of two alternative patches, BTW:
1) Simply use #define HAVE_FOO 0, instead of not defining HAVE_FOO at all
2) Change
  #if HAVE_FOO
to
  #if HAVE_FOO+0
which always does the right thing.

But I think I still prefer the attached patch :-).

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401633
parent 678ac924
...@@ -63,7 +63,7 @@ typedef unsigned int uintptr_t; ...@@ -63,7 +63,7 @@ typedef unsigned int uintptr_t;
/* Enabled for SDL 1.2 (binary compatibility) */ /* Enabled for SDL 1.2 (binary compatibility) */
#define HAVE_LIBC 1 #define HAVE_LIBC 1
#if HAVE_LIBC #ifdef HAVE_LIBC
/* Useful headers */ /* Useful headers */
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
......
...@@ -28,49 +28,47 @@ ...@@ -28,49 +28,47 @@
#include "SDL_config.h" #include "SDL_config.h"
#if HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#if HAVE_STDIO_H #ifdef HAVE_STDIO_H
#include <stdio.h> #include <stdio.h>
#endif #endif
#if STDC_HEADERS #if defined(STDC_HEADERS)
# include <stdlib.h> # include <stdlib.h>
# include <stddef.h> # include <stddef.h>
# include <stdarg.h> # include <stdarg.h>
#else #else
# if HAVE_STDLIB_H # if defined(HAVE_STDLIB_H)
# include <stdlib.h> # include <stdlib.h>
# elif HAVE_MALLOC_H # elif defined(HAVE_MALLOC_H)
# include <malloc.h> # include <malloc.h>
# endif # endif
# if HAVE_STDDEF_H # if defined(HAVE_STDDEF_H)
# include <stddef.h> # include <stddef.h>
# endif # endif
# if HAVE_STDARG_H # if defined(HAVE_STDARG_H)
# include <stdarg.h> # include <stdarg.h>
# endif # endif
#endif #endif
#if HAVE_STRING_H #ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
# include <memory.h> # include <memory.h>
# endif # endif
# include <string.h> # include <string.h>
#endif #endif
#if HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif #endif
#if HAVE_INTTYPES_H #if defined(HAVE_INTTYPES_H)
# include <inttypes.h> # include <inttypes.h>
#else #elif defined(HAVE_STDINT_H)
# if HAVE_STDINT_H
# include <stdint.h> # include <stdint.h>
# endif
#endif #endif
#if HAVE_CTYPE_H #ifdef HAVE_CTYPE_H
# include <ctype.h> # include <ctype.h>
#endif #endif
#if HAVE_ICONV_H #ifdef HAVE_ICONV_H
# include <iconv.h> # include <iconv.h>
#endif #endif
...@@ -138,32 +136,32 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); ...@@ -138,32 +136,32 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
extern "C" { extern "C" {
#endif #endif
#if HAVE_MALLOC #ifdef HAVE_MALLOC
#define SDL_malloc malloc #define SDL_malloc malloc
#else #else
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
#endif #endif
#if HAVE_CALLOC #ifdef HAVE_CALLOC
#define SDL_calloc calloc #define SDL_calloc calloc
#else #else
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
#endif #endif
#if HAVE_REALLOC #ifdef HAVE_REALLOC
#define SDL_realloc realloc #define SDL_realloc realloc
#else #else
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
#endif #endif
#if HAVE_FREE #ifdef HAVE_FREE
#define SDL_free free #define SDL_free free
#else #else
extern DECLSPEC void SDLCALL SDL_free(void *mem); extern DECLSPEC void SDLCALL SDL_free(void *mem);
#endif #endif
#if HAVE_ALLOCA && !defined(alloca) #if defined(HAVE_ALLOCA) && !defined(alloca)
# if HAVE_ALLOCA_H # if defined(HAVE_ALLOCA_H)
# include <alloca.h> # include <alloca.h>
# elif defined(__GNUC__) # elif defined(__GNUC__)
# define alloca __builtin_alloca # define alloca __builtin_alloca
...@@ -176,7 +174,7 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem); ...@@ -176,7 +174,7 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem);
char *alloca (); char *alloca ();
# endif # endif
#endif #endif
#if HAVE_ALLOCA #ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count) #define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count)
#define SDL_stack_free(data) #define SDL_stack_free(data)
#else #else
...@@ -184,26 +182,26 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem); ...@@ -184,26 +182,26 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem);
#define SDL_stack_free(data) SDL_free(data) #define SDL_stack_free(data) SDL_free(data)
#endif #endif
#if HAVE_GETENV #ifdef HAVE_GETENV
#define SDL_getenv getenv #define SDL_getenv getenv
#else #else
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#endif #endif
#if HAVE_PUTENV #ifdef HAVE_PUTENV
#define SDL_putenv putenv #define SDL_putenv putenv
#else #else
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
#endif #endif
#if HAVE_QSORT #ifdef HAVE_QSORT
#define SDL_qsort qsort #define SDL_qsort qsort
#else #else
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
int (*compare)(const void *, const void *)); int (*compare)(const void *, const void *));
#endif #endif
#if HAVE_ABS #ifdef HAVE_ABS
#define SDL_abs abs #define SDL_abs abs
#else #else
#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) #define SDL_abs(X) ((X) < 0 ? -(X) : (X))
...@@ -212,7 +210,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, ...@@ -212,7 +210,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) #define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) #define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
#if HAVE_CTYPE_H #ifdef HAVE_CTYPE_H
#define SDL_isdigit(X) isdigit(X) #define SDL_isdigit(X) isdigit(X)
#define SDL_isspace(X) isspace(X) #define SDL_isspace(X) isspace(X)
#define SDL_toupper(X) toupper(X) #define SDL_toupper(X) toupper(X)
...@@ -224,7 +222,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, ...@@ -224,7 +222,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) #define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
#endif #endif
#if HAVE_MEMSET #ifdef HAVE_MEMSET
#define SDL_memset memset #define SDL_memset memset
#else #else
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
...@@ -279,9 +277,9 @@ do { \ ...@@ -279,9 +277,9 @@ do { \
} while(0) } while(0)
#endif #endif
#ifndef SDL_memcpy #ifndef SDL_memcpy
#if HAVE_MEMCPY #ifdef HAVE_MEMCPY
#define SDL_memcpy memcpy #define SDL_memcpy memcpy
#elif HAVE_BCOPY #elif defined(HAVE_BCOPY)
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) #define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
#else #else
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
...@@ -334,9 +332,9 @@ do { \ ...@@ -334,9 +332,9 @@ do { \
extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
#endif #endif
#if HAVE_MEMMOVE #ifdef HAVE_MEMMOVE
#define SDL_memmove memmove #define SDL_memmove memmove
#elif HAVE_BCOPY #elif defined(HAVE_BCOPY)
#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) #define SDL_memmove(d, s, n) bcopy((s), (d), (n))
#else #else
#define SDL_memmove(dst, src, len) \ #define SDL_memmove(dst, src, len) \
...@@ -349,133 +347,133 @@ do { \ ...@@ -349,133 +347,133 @@ do { \
} while(0) } while(0)
#endif #endif
#if HAVE_MEMCMP #ifdef HAVE_MEMCMP
#define SDL_memcmp memcmp #define SDL_memcmp memcmp
#else #else
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
#endif #endif
#if HAVE_STRLEN #ifdef HAVE_STRLEN
#define SDL_strlen strlen #define SDL_strlen strlen
#else #else
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
#endif #endif
#if HAVE_STRLCPY #ifdef HAVE_STRLCPY
#define SDL_strlcpy strlcpy #define SDL_strlcpy strlcpy
#else #else
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
#endif #endif
#if HAVE_STRLCAT #ifdef HAVE_STRLCAT
#define SDL_strlcat strlcat #define SDL_strlcat strlcat
#else #else
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
#endif #endif
#if HAVE_STRDUP #ifdef HAVE_STRDUP
#define SDL_strdup strdup #define SDL_strdup strdup
#else #else
extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
#endif #endif
#if HAVE__STRREV #ifdef HAVE__STRREV
#define SDL_strrev _strrev #define SDL_strrev _strrev
#else #else
extern DECLSPEC char * SDLCALL SDL_strrev(char *string); extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
#endif #endif
#if HAVE__STRUPR #ifdef HAVE__STRUPR
#define SDL_strupr _strupr #define SDL_strupr _strupr
#else #else
extern DECLSPEC char * SDLCALL SDL_strupr(char *string); extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
#endif #endif
#if HAVE__STRLWR #ifdef HAVE__STRLWR
#define SDL_strlwr _strlwr #define SDL_strlwr _strlwr
#else #else
extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
#endif #endif
#if HAVE_STRCHR #ifdef HAVE_STRCHR
#define SDL_strchr strchr #define SDL_strchr strchr
#elif HAVE_INDEX #elif defined(HAVE_INDEX)
#define SDL_strchr index #define SDL_strchr index
#else #else
extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
#endif #endif
#if HAVE_STRRCHR #ifdef HAVE_STRRCHR
#define SDL_strrchr strrchr #define SDL_strrchr strrchr
#elif HAVE_RINDEX #elif defined(HAVE_RINDEX)
#define SDL_strrchr rindex #define SDL_strrchr rindex
#else #else
extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
#endif #endif
#if HAVE_STRSTR #ifdef HAVE_STRSTR
#define SDL_strstr strstr #define SDL_strstr strstr
#else #else
extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
#endif #endif
#if HAVE_ITOA #ifdef HAVE_ITOA
#define SDL_itoa itoa #define SDL_itoa itoa
#else #else
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) #define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
#endif #endif
#if HAVE__LTOA #ifdef HAVE__LTOA
#define SDL_ltoa _ltoa #define SDL_ltoa _ltoa
#else #else
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
#endif #endif
#if HAVE__UITOA #ifdef HAVE__UITOA
#define SDL_uitoa _uitoa #define SDL_uitoa _uitoa
#else #else
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) #define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
#endif #endif
#if HAVE__ULTOA #ifdef HAVE__ULTOA
#define SDL_ultoa _ultoa #define SDL_ultoa _ultoa
#else #else
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
#endif #endif
#if HAVE_STRTOL #ifdef HAVE_STRTOL
#define SDL_strtol strtol #define SDL_strtol strtol
#else #else
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
#endif #endif
#if HAVE_STRTOUL #ifdef HAVE_STRTOUL
#define SDL_strtoul strtoul #define SDL_strtoul strtoul
#else #else
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
#endif #endif
#if SDL_HAS_64BIT_TYPE #ifdef SDL_HAS_64BIT_TYPE
#if HAVE__I64TOA #ifdef HAVE__I64TOA
#define SDL_lltoa _i64toa #define SDL_lltoa _i64toa
#else #else
extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
#endif #endif
#if HAVE__UI64TOA #ifdef HAVE__UI64TOA
#define SDL_ulltoa _ui64toa #define SDL_ulltoa _ui64toa
#else #else
extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
#endif #endif
#if HAVE_STRTOLL #ifdef HAVE_STRTOLL
#define SDL_strtoll strtoll #define SDL_strtoll strtoll
#else #else
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
#endif #endif
#if HAVE_STRTOULL #ifdef HAVE_STRTOULL
#define SDL_strtoull strtoull #define SDL_strtoull strtoull
#else #else
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
...@@ -483,65 +481,65 @@ extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int ...@@ -483,65 +481,65 @@ extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int
#endif /* SDL_HAS_64BIT_TYPE */ #endif /* SDL_HAS_64BIT_TYPE */
#if HAVE_STRTOD #ifdef HAVE_STRTOD
#define SDL_strtod strtod #define SDL_strtod strtod
#else #else
extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
#endif #endif
#if HAVE_ATOI #ifdef HAVE_ATOI
#define SDL_atoi atoi #define SDL_atoi atoi
#else #else
#define SDL_atoi(X) SDL_strtol(X, NULL, 0) #define SDL_atoi(X) SDL_strtol(X, NULL, 0)
#endif #endif
#if HAVE_ATOF #ifdef HAVE_ATOF
#define SDL_atof atof #define SDL_atof atof
#else #else
#define SDL_atof(X) SDL_strtod(X, NULL) #define SDL_atof(X) SDL_strtod(X, NULL)
#endif #endif
#if HAVE_STRCMP #ifdef HAVE_STRCMP
#define SDL_strcmp strcmp #define SDL_strcmp strcmp
#else #else
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
#endif #endif
#if HAVE_STRNCMP #ifdef HAVE_STRNCMP
#define SDL_strncmp strncmp #define SDL_strncmp strncmp
#else #else
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
#endif #endif
#if HAVE_STRCASECMP #ifdef HAVE_STRCASECMP
#define SDL_strcasecmp strcasecmp #define SDL_strcasecmp strcasecmp
#elif HAVE__STRICMP #elif defined(HAVE__STRICMP)
#define SDL_strcasecmp _stricmp #define SDL_strcasecmp _stricmp
#else #else
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
#endif #endif
#if HAVE_STRNCASECMP #ifdef HAVE_STRNCASECMP
#define SDL_strncasecmp strncasecmp #define SDL_strncasecmp strncasecmp
#elif HAVE__STRNICMP #elif defined(HAVE__STRNICMP)
#define SDL_strncasecmp _strnicmp #define SDL_strncasecmp _strnicmp
#else #else
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
#endif #endif
#if HAVE_SSCANF #ifdef HAVE_SSCANF
#define SDL_sscanf sscanf #define SDL_sscanf sscanf
#else #else
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
#endif #endif
#if HAVE_SNPRINTF #ifdef HAVE_SNPRINTF
#define SDL_snprintf snprintf #define SDL_snprintf snprintf
#else #else
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
#endif #endif
#if HAVE_VSNPRINTF #ifdef HAVE_VSNPRINTF
#define SDL_vsnprintf vsnprintf #define SDL_vsnprintf vsnprintf
#else #else
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
...@@ -553,7 +551,7 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char ...@@ -553,7 +551,7 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char
#define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EILSEQ (size_t)-3
#define SDL_ICONV_EINVAL (size_t)-4 #define SDL_ICONV_EINVAL (size_t)-4
#if HAVE_ICONV #ifdef HAVE_ICONV
#define SDL_iconv_t iconv_t #define SDL_iconv_t iconv_t
#define SDL_iconv_open iconv_open #define SDL_iconv_open iconv_open
#define SDL_iconv_close iconv_close #define SDL_iconv_close iconv_close
......
...@@ -46,7 +46,7 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo; ...@@ -46,7 +46,7 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else #else
/* This is the structure for custom window manager events */ /* This is the structure for custom window manager events */
#if SDL_VIDEO_DRIVER_X11 #if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__) #if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */ /* conflicts with Quickdraw.h */
#define Cursor X11Cursor #define Cursor X11Cursor
...@@ -100,7 +100,7 @@ typedef struct SDL_SysWMinfo { ...@@ -100,7 +100,7 @@ typedef struct SDL_SysWMinfo {
} info; } info;
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif SDL_VIDEO_DRIVER_NANOX #elif defined(SDL_VIDEO_DRIVER_NANOX)
#include <microwin/nano-X.h> #include <microwin/nano-X.h>
/* The generic custom event structure */ /* The generic custom event structure */
...@@ -115,7 +115,7 @@ typedef struct SDL_SysWMinfo { ...@@ -115,7 +115,7 @@ typedef struct SDL_SysWMinfo {
GR_WINDOW_ID window ; /* The display window */ GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif SDL_VIDEO_DRIVER_WINDIB || SDL_VIDEO_DRIVER_DDRAW #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
...@@ -135,7 +135,7 @@ typedef struct SDL_SysWMinfo { ...@@ -135,7 +135,7 @@ typedef struct SDL_SysWMinfo {
HGLRC hglrc; /* The OpenGL context, if any */ HGLRC hglrc; /* The OpenGL context, if any */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif SDL_VIDEO_DRIVER_RISCOS #elif defined(SDL_VIDEO_DRIVER_RISCOS)
/* RISC OS custom event structure */ /* RISC OS custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
...@@ -152,7 +152,7 @@ typedef struct SDL_SysWMinfo { ...@@ -152,7 +152,7 @@ typedef struct SDL_SysWMinfo {
int window; /* The RISC OS display window */ int window; /* The RISC OS display window */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif SDL_VIDEO_DRIVER_PHOTON #elif defined(SDL_VIDEO_DRIVER_PHOTON)
#include <sys/neutrino.h> #include <sys/neutrino.h>
#include <Ph.h> #include <Ph.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment