From a0a6ae11e30bdb59b127166e4748b6496342a27e Mon Sep 17 00:00:00 2001 From: neil <neil@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sat, 15 May 2010 22:55:25 +0000 Subject: [PATCH] Centralize SDL headers to centralize Mac port ifdefs git-svn-id: http://svn.net-core.org/repos/t-engine4@607 51575b47-30f0-44d4-a5cc-537603b46e54 --- src/core_lua.c | 2 +- src/display_sdl.c | 1 - src/display_sdl.h | 2 +- src/mac/SDLMain.m | 2 +- src/main.c | 2 +- src/map.c | 3 +-- src/music.c | 3 +-- src/particles.c | 3 +-- src/tSDL.h | 9 +++++++++ 9 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/tSDL.h diff --git a/src/core_lua.c b/src/core_lua.c index 62748ea0a2..047f0f5711 100644 --- a/src/core_lua.c +++ b/src/core_lua.c @@ -30,7 +30,7 @@ #include "SFMT.h" #include "mzip.h" #include "main.h" -#include <SDL_ttf.h> +#include "tSDL.h" /****************************************************************** ****************************************************************** diff --git a/src/display_sdl.c b/src/display_sdl.c index 0268528fe6..97ec6f7d99 100644 --- a/src/display_sdl.c +++ b/src/display_sdl.c @@ -18,7 +18,6 @@ Nicolas Casalini "DarkGod" darkgod@te4.org */ -#include "SDL.h" #include "display_sdl.h" #include <stdlib.h> diff --git a/src/display_sdl.h b/src/display_sdl.h index 5bb1e31cff..bc20e15081 100644 --- a/src/display_sdl.h +++ b/src/display_sdl.h @@ -21,7 +21,7 @@ #ifndef DISPLAY_SDL_H #define DISPLAY_SDL_H -#include <SDL.h> +#include "tSDL.h" #include <gl.h> #include <glu.h> #include <glext.h> diff --git a/src/mac/SDLMain.m b/src/mac/SDLMain.m index 2b802d3e6f..487b49b30f 100644 --- a/src/mac/SDLMain.m +++ b/src/mac/SDLMain.m @@ -5,7 +5,7 @@ Feel free to customize this file to suit your needs */ -#import "SDL.h" +#import <SDL/SDL.h> #import "SDLMain.h" #import <sys/param.h> /* for MAXPATHLEN */ #import <unistd.h> diff --git a/src/main.c b/src/main.c index dcae46bcff..5f17f6592c 100644 --- a/src/main.c +++ b/src/main.c @@ -23,7 +23,7 @@ #include <stdlib.h> #include <time.h> #include <sys/time.h> -#include <SDL_mixer.h> +#include "tSDL.h" #include "lua.h" #include "lauxlib.h" #include "lualib.h" diff --git a/src/map.c b/src/map.c index 97f0cf19f8..bf11c9a55d 100644 --- a/src/map.c +++ b/src/map.c @@ -25,8 +25,7 @@ #include "types.h" #include "map.h" #include "script.h" -#include <SDL.h> -#include <SDL_ttf.h> +#include "tSDL.h" // Minimap defines #define MM_FLOOR 1 diff --git a/src/music.c b/src/music.c index aec94454fe..ed2b00091d 100644 --- a/src/music.c +++ b/src/music.c @@ -25,8 +25,7 @@ #include "types.h" #include "music.h" #include "script.h" -#include <SDL.h> -#include <SDL_mixer.h> +#include "tSDL.h" bool sound_active = TRUE; diff --git a/src/particles.c b/src/particles.c index 236dd5fb97..71450069fa 100644 --- a/src/particles.c +++ b/src/particles.c @@ -26,8 +26,7 @@ #include "particles.h" #include "script.h" #include <math.h> -#include <SDL.h> -#include <SDL_ttf.h> +#include "tSDL.h" #define rng(x, y) (x + rand_div(1 + y - x)) diff --git a/src/tSDL.h b/src/tSDL.h new file mode 100644 index 0000000000..6ef880bcf5 --- /dev/null +++ b/src/tSDL.h @@ -0,0 +1,9 @@ +#ifdef __APPLE__ +#include <SDL/SDL.h> +#include <SDL_ttf/SDL_ttf.h> +#include <SDL_mixer/SDL_mixer.h> +#else +#include <SDL.h> +#include <SDL_ttf.h> +#include <SDL_mixer.h> +#endif -- GitLab