Mercurial > sdl-ios-xcode
comparison include/SDL_syswm.h @ 1626:a80e1e0880b8
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 :-).
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Apr 2006 13:38:40 +0000 |
parents | dc6b59e925a2 |
children | 14717b52abc0 |
comparison
equal
deleted
inserted
replaced
1625:7e89aa7843c5 | 1626:a80e1e0880b8 |
---|---|
44 struct SDL_SysWMinfo; | 44 struct SDL_SysWMinfo; |
45 typedef struct SDL_SysWMinfo SDL_SysWMinfo; | 45 typedef struct SDL_SysWMinfo SDL_SysWMinfo; |
46 #else | 46 #else |
47 | 47 |
48 /* This is the structure for custom window manager events */ | 48 /* This is the structure for custom window manager events */ |
49 #if SDL_VIDEO_DRIVER_X11 | 49 #if defined(SDL_VIDEO_DRIVER_X11) |
50 #if defined(__APPLE__) && defined(__MACH__) | 50 #if defined(__APPLE__) && defined(__MACH__) |
51 /* conflicts with Quickdraw.h */ | 51 /* conflicts with Quickdraw.h */ |
52 #define Cursor X11Cursor | 52 #define Cursor X11Cursor |
53 #endif | 53 #endif |
54 | 54 |
98 Window wmwindow; /* The X11 managed input window */ | 98 Window wmwindow; /* The X11 managed input window */ |
99 } x11; | 99 } x11; |
100 } info; | 100 } info; |
101 } SDL_SysWMinfo; | 101 } SDL_SysWMinfo; |
102 | 102 |
103 #elif SDL_VIDEO_DRIVER_NANOX | 103 #elif defined(SDL_VIDEO_DRIVER_NANOX) |
104 #include <microwin/nano-X.h> | 104 #include <microwin/nano-X.h> |
105 | 105 |
106 /* The generic custom event structure */ | 106 /* The generic custom event structure */ |
107 struct SDL_SysWMmsg { | 107 struct SDL_SysWMmsg { |
108 SDL_version version; | 108 SDL_version version; |
113 typedef struct SDL_SysWMinfo { | 113 typedef struct SDL_SysWMinfo { |
114 SDL_version version ; | 114 SDL_version version ; |
115 GR_WINDOW_ID window ; /* The display window */ | 115 GR_WINDOW_ID window ; /* The display window */ |
116 } SDL_SysWMinfo; | 116 } SDL_SysWMinfo; |
117 | 117 |
118 #elif SDL_VIDEO_DRIVER_WINDIB || SDL_VIDEO_DRIVER_DDRAW | 118 #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) |
119 #define WIN32_LEAN_AND_MEAN | 119 #define WIN32_LEAN_AND_MEAN |
120 #include <windows.h> | 120 #include <windows.h> |
121 | 121 |
122 /* The windows custom event structure */ | 122 /* The windows custom event structure */ |
123 struct SDL_SysWMmsg { | 123 struct SDL_SysWMmsg { |
133 SDL_version version; | 133 SDL_version version; |
134 HWND window; /* The Win32 display window */ | 134 HWND window; /* The Win32 display window */ |
135 HGLRC hglrc; /* The OpenGL context, if any */ | 135 HGLRC hglrc; /* The OpenGL context, if any */ |
136 } SDL_SysWMinfo; | 136 } SDL_SysWMinfo; |
137 | 137 |
138 #elif SDL_VIDEO_DRIVER_RISCOS | 138 #elif defined(SDL_VIDEO_DRIVER_RISCOS) |
139 | 139 |
140 /* RISC OS custom event structure */ | 140 /* RISC OS custom event structure */ |
141 struct SDL_SysWMmsg { | 141 struct SDL_SysWMmsg { |
142 SDL_version version; | 142 SDL_version version; |
143 int eventCode; /* The window for the message */ | 143 int eventCode; /* The window for the message */ |
150 int wimpVersion; /* Wimp version running under */ | 150 int wimpVersion; /* Wimp version running under */ |
151 int taskHandle; /* The RISC OS task handle */ | 151 int taskHandle; /* The RISC OS task handle */ |
152 int window; /* The RISC OS display window */ | 152 int window; /* The RISC OS display window */ |
153 } SDL_SysWMinfo; | 153 } SDL_SysWMinfo; |
154 | 154 |
155 #elif SDL_VIDEO_DRIVER_PHOTON | 155 #elif defined(SDL_VIDEO_DRIVER_PHOTON) |
156 #include <sys/neutrino.h> | 156 #include <sys/neutrino.h> |
157 #include <Ph.h> | 157 #include <Ph.h> |
158 | 158 |
159 /* The QNX custom event structure */ | 159 /* The QNX custom event structure */ |
160 struct SDL_SysWMmsg { | 160 struct SDL_SysWMmsg { |