Browse Source

Add and update include guards

Include guards in most changed files were missing, I added them keeping
the same style as other SDL files. In some cases I moved the include
guards around to be the first thing the header has to take advantage of
any possible improvements compiler may have for inclusion guards.
Micha? Janiszewski 6 years ago
parent
commit
91820998fc

+ 5 - 0
src/SDL_assert_c.h

@@ -19,6 +19,11 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_assert_c_h_
+#define SDL_assert_c_h_
+
 extern void SDL_AssertionsQuit(void);
 
+#endif /* SDL_assert_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/audio/SDL_audiodev_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_audiodev_c_h_
+#define SDL_audiodev_c_h_
+
 #include "SDL.h"
 #include "../SDL_internal.h"
 #include "SDL_sysaudio.h"
@@ -35,4 +39,6 @@
 
 extern void SDL_EnumUnixAudioDevices(const int classic, int (*test)(int));
 
+#endif /* SDL_audiodev_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 0
src/core/linux/SDL_evdev_kbd.h

@@ -19,6 +19,9 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_evdev_kbd_h_
+#define SDL_evdev_kbd_h_
+
 struct SDL_EVDEV_keyboard_state;
 typedef struct SDL_EVDEV_keyboard_state SDL_EVDEV_keyboard_state;
 
@@ -26,4 +29,6 @@ extern SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void);
 extern void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down);
 extern void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state);
 
+#endif /* SDL_evdev_kbd_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/events/SDL_events_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_events_c_h_
+#define SDL_events_c_h_
+
 #include "../SDL_internal.h"
 
 /* Useful functions and variables from SDL_events.c */
@@ -49,4 +53,6 @@ extern void SDL_QuitQuit(void);
 
 extern void SDL_SendPendingQuit(void);
 
+#endif /* SDL_events_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/events/scancodes_xfree86.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef scancodes_xfree86_h_
+#define scancodes_xfree86_h_
+
 #include "../../include/SDL_scancode.h"
 
 /* XFree86 key code to SDL scancode mapping table
@@ -503,4 +507,6 @@ static const SDL_Scancode xvnc_scancode_table[] = {
     /*  80 */   SDL_SCANCODE_F12,
 };
 
+#endif /* scancodes_xfree86_h_ */
+
 /* *INDENT-ON* */

+ 5 - 0
src/haptic/SDL_haptic_c.h

@@ -19,7 +19,12 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_haptic_c_h_
+#define SDL_haptic_c_h_
+
 extern int SDL_HapticInit(void);
 extern void SDL_HapticQuit(void);
 
+#endif /* SDL_haptic_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/joystick/SDL_joystick_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_joystick_c_h_
+#define SDL_joystick_c_h_
+
 #include "../SDL_internal.h"
 
 /* Useful functions and variables from SDL_joystick.c */
@@ -97,4 +101,6 @@ extern void SDL_PrivateJoystickBatteryLevel(SDL_Joystick * joystick,
 /* Internal sanity checking functions */
 extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick);
 
+#endif /* SDL_joystick_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 0
src/joystick/linux/SDL_sysjoystick_c.h

@@ -19,6 +19,9 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_sysjoystick_c_h_
+#define SDL_sysjoystick_c_h_
+
 #include <linux/input.h>
 
 struct SDL_joylist_item;
@@ -61,4 +64,6 @@ struct joystick_hwdata
     SDL_bool m_bSteamController;
 };
 
+#endif /* SDL_sysjoystick_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/joystick/steam/SDL_steamcontroller.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_steamcontroller_h_
+#define SDL_steamcontroller_h_
+
 #include "../../SDL_internal.h"
 
 typedef SDL_bool (*SteamControllerConnectedCallback_t)(const char *name, SDL_JoystickGUID guid, int *device_instance);
@@ -30,4 +34,6 @@ void SDL_UpdateSteamControllers(void);
 void SDL_UpdateSteamController(SDL_Joystick *joystick);
 void SDL_QuitSteamControllers(void);
 
+#endif /* SDL_steamcontroller_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/libm/math_libm.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef math_libm_h_
+#define math_libm_h_
+
 #include "../SDL_internal.h"
 
 /* Math routines from uClibc: http://www.uclibc.org */
@@ -38,4 +42,6 @@ double SDL_uclibc_sin(double x);
 double SDL_uclibc_sqrt(double x);
 double SDL_uclibc_tan(double x);
 
+#endif /* math_libm_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/SDL_yuv_sw_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_yuv_sw_c_h_
+#define SDL_yuv_sw_c_h_
+
 #include "../SDL_internal.h"
 
 #include "SDL_video.h"
@@ -64,4 +68,6 @@ void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
 #define USE_MMX_ASSEMBLY 1
 #endif
 
+#endif /* SDL_yuv_sw_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/opengl/SDL_shaders_gl.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_shaders_gl_h_
+#define SDL_shaders_gl_h_
+
 #include "../../SDL_internal.h"
 
 /* OpenGL shader implementation */
@@ -44,4 +48,6 @@ extern GL_ShaderContext * GL_CreateShaderContext(void);
 extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader);
 extern void GL_DestroyShaderContext(GL_ShaderContext *ctx);
 
+#endif /* SDL_shaders_gl_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/software/SDL_blendfillrect.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_blendfillrect_h_
+#define SDL_blendfillrect_h_
+
 #include "../../SDL_internal.h"
 
 
 extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
+#endif /* SDL_blendfillrect_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/software/SDL_blendline.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_blendline_h_
+#define SDL_blendline_h_
+
 #include "../../SDL_internal.h"
 
 
 extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
+#endif /* SDL_blendline_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/software/SDL_blendpoint.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_blendpoint_h_
+#define SDL_blendpoint_h_
+
 #include "../../SDL_internal.h"
 
 
 extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
+#endif /* SDL_blendpoint_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/software/SDL_drawline.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_drawline_h_
+#define SDL_drawline_h_
+
 #include "../../SDL_internal.h"
 
 
 extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
 extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
 
+#endif /* SDL_drawline_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/render/software/SDL_drawpoint.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_drawpoint_h_
+#define SDL_drawpoint_h_
+
 #include "../../SDL_internal.h"
 
 
 extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color);
 extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
 
+#endif /* SDL_drawpoint_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 0
src/render/software/SDL_render_sw_c.h

@@ -19,6 +19,11 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_render_sw_c_h_
+#define SDL_render_sw_c_h_
+
 extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface);
 
+#endif /* SDL_render_sw_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 4 - 0
src/render/software/SDL_rotate.h

@@ -19,6 +19,9 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_rotate_h_
+#define SDL_rotate_h_
+
 #ifndef MIN
 #define MIN(a,b)    (((a) < (b)) ? (a) : (b))
 #endif
@@ -26,3 +29,4 @@
 extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle);
 extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle);
 
+#endif /* SDL_rotate_h_ */

+ 6 - 0
src/sensor/SDL_sensor_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_sensor_c_h_
+#define SDL_sensor_c_h_
+
 #include "SDL_config.h"
 
 struct _SDL_SensorDriver;
@@ -35,4 +39,6 @@ extern void SDL_SensorQuit(void);
 /* Internal event queueing functions */
 extern int SDL_PrivateSensorUpdate(SDL_Sensor *sensor, float *data, int num_values);
 
+#endif /* SDL_sensor_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/sensor/SDL_syssensor.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_syssensor_c_h_
+#define SDL_syssensor_c_h_
+
 #include "SDL_config.h"
 
 /* This is the system specific header for the SDL sensor API */
@@ -96,4 +100,6 @@ extern SDL_SensorDriver SDL_ANDROID_SensorDriver;
 extern SDL_SensorDriver SDL_COREMOTION_SensorDriver;
 extern SDL_SensorDriver SDL_DUMMY_SensorDriver;
 
+#endif /* SDL_syssensor_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/timer/SDL_timer_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_timer_c_h_
+#define SDL_timer_c_h_
+
 #include "../SDL_internal.h"
 
 /* Useful functions and variables from SDL_timer.c */
@@ -31,4 +35,6 @@ extern void SDL_TicksQuit(void);
 extern int SDL_TimerInit(void);
 extern void SDL_TimerQuit(void);
 
+#endif /* SDL_timer_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 7 - 0
src/video/SDL_RLEaccel_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_RLEaccel_c_h_
+#define SDL_RLEaccel_c_h_
+
 #include "../SDL_internal.h"
 
 /* Useful functions and variables from SDL_RLEaccel.c */
@@ -28,4 +32,7 @@ extern int SDLCALL SDL_RLEBlit     (SDL_Surface * src, SDL_Rect * srcrect,
 extern int SDLCALL SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect,
                                     SDL_Surface * dst, SDL_Rect * dstrect);
 extern void SDL_UnRLESurface(SDL_Surface * surface, int recode);
+
+#endif /* SDL_RLEaccel_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 0
src/video/SDL_blit_copy.h

@@ -19,6 +19,11 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_blit_copy_h_
+#define SDL_blit_copy_h_
+
 void SDL_BlitCopy(SDL_BlitInfo * info);
 
+#endif /* SDL_blit_copy_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/SDL_blit_slow.h

@@ -18,8 +18,14 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_blit_slow_h_
+#define SDL_blit_slow_h_
+
 #include "../SDL_internal.h"
 
 extern void SDL_Blit_Slow(SDL_BlitInfo * info);
 
+#endif /* SDL_blit_slow_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/SDL_pixels_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_pixels_c_h_
+#define SDL_pixels_c_h_
+
 #include "../SDL_internal.h"
 
 /* Useful functions and variables from SDL_pixel.c */
@@ -37,4 +41,6 @@ extern void SDL_FreeBlitMap(SDL_BlitMap * map);
 extern void SDL_DitherColors(SDL_Color * colors, int bpp);
 extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
+#endif /* SDL_pixels_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/SDL_rect_c.h

@@ -18,8 +18,14 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_rect_c_h_
+#define SDL_rect_c_h_
+
 #include "../SDL_internal.h"
 
 extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span);
 
+#endif /* SDL_rect_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/SDL_yuv_c.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_yuv_c_h_
+#define SDL_yuv_c_h_
+
 #include "../SDL_internal.h"
 
 
@@ -27,4 +31,6 @@ extern int SDL_ConvertPixels_YUV_to_RGB(int width, int height, Uint32 src_format
 extern int SDL_ConvertPixels_RGB_to_YUV(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch);
 extern int SDL_ConvertPixels_YUV_to_YUV(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch);
 
+#endif /* SDL_yuv_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/dummy/SDL_nullevents_c.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_nullevents_c_h_
+#define SDL_nullevents_c_h_
+
 #include "../../SDL_internal.h"
 
 #include "SDL_nullvideo.h"
 
 extern void DUMMY_PumpEvents(_THIS);
 
+#endif /* SDL_nullevents_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 6 - 0
src/video/dummy/SDL_nullframebuffer_c.h

@@ -18,10 +18,16 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_nullframebuffer_c_h_
+#define SDL_nullframebuffer_c_h_
+
 #include "../../SDL_internal.h"
 
 extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
 extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
 extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 
+#endif /* SDL_nullframebuffer_c_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 5
src/video/wayland/SDL_waylandtouch.h

@@ -19,13 +19,13 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_waylandtouch_h_
+#define SDL_waylandtouch_h_
+
 #include "../../SDL_internal.h"
 
 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
 
-#ifndef SDL_waylandtouch_h_
-#define SDL_waylandtouch_h_
-
 #include "SDL_waylandvideo.h"
 #include <stdint.h>
 #include <stddef.h>
@@ -347,6 +347,6 @@ qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t re
              QT_WINDOWMANAGER_OPEN_URL, remaining, url);
 }
 
-#endif /* SDL_waylandtouch_h_ */
-
 #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
+
+#endif /* SDL_waylandtouch_h_ */

+ 6 - 0
src/video/x11/SDL_x11framebuffer.h

@@ -18,6 +18,10 @@
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
+
+#ifndef SDL_x11framebuffer_h_
+#define SDL_x11framebuffer_h_
+
 #include "../../SDL_internal.h"
 
 
@@ -28,4 +32,6 @@ extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
                                        const SDL_Rect * rects, int numrects);
 extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
 
+#endif /* SDL_x11framebuffer_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */

+ 5 - 0
src/video/x11/SDL_x11messagebox.h

@@ -19,10 +19,15 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+#ifndef SDL_x11messagebox_h_
+#define SDL_x11messagebox_h_
+
 #if SDL_VIDEO_DRIVER_X11
 
 extern int X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
 
 #endif /* SDL_VIDEO_DRIVER_X11 */
 
+#endif /* SDL_x11messagebox_h_ */
+
 /* vi: set ts=4 sw=4 expandtab: */