Skip to content
Permalink
Browse files

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.
  • Loading branch information
janisozaur committed Oct 28, 2018
1 parent df89abb commit 91820998fc8561b69de0464c58b7f740a9a24728
@@ -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: */
@@ -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: */
@@ -19,11 +19,16 @@
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;

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: */
@@ -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: */
@@ -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* */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -19,10 +19,14 @@
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

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_ */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */
@@ -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: */

0 comments on commit 9182099

Please sign in to comment.