Fixes for SDL detection.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1681 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-04-24 17:52:09 +00:00
parent fcbe70950f
commit 946280ddac
3 changed files with 26 additions and 11 deletions
+24 -9
View File
@@ -137,20 +137,35 @@ iswgraph(wint_t wc)
} }
#endif #endif
// Use SDL_INCLUDE to portably include the SDL files from the right // Use SDL_INCLUDE and SDL_IMAGE_INCLUDE to portably include the SDL files
// location. TODO: Where SDL_H is located could be detected from the build // from the right location.
// script. // TODO: Where the SDL and SDL_image headers are located could be detected
// from the build script.
#ifdef __APPLE__ #ifdef __APPLE__
# define HAVE_SDL_SDL_H // SDL_image.h in a directory SDL_image under the include dir.
# define SDL_DIR SDL
# define SDL_IMAGE_DIR SDL_image
#else #else
# define HAVE_SDL_H // SDL_image.h directly under the include dir.
# define SDL_DIR
# define SDL_IMAGE_DIR
#endif #endif
#ifdef HAVE_SDL_H
#define xSDL_DIR x##SDL_DIR
#if xSDL_DIR == x
# define SDL_INCLUDE(file) <file> # define SDL_INCLUDE(file) <file>
#elif defined(HAVE_SDL_SDL_H) #else
# define SDL_INCLUDE(file) <SDL/file> # define SDL_INCLUDE(file) <SDL_DIR/file>
#endif #endif
#undef xSDL_DIR
#define xSDL_IMAGE_DIR x##SDL_IMAGE_DIR
#if xSDL_IMAGE_DIR == x
# define SDL_IMAGE_INCLUDE(file) <file>
#else
# define SDL_IMAGE_INCLUDE(file) <SDL_IMAGE_DIR/file>
#endif
#undef xSDL_IMAGE_DIR
#endif /* _PORT_H */ #endif /* _PORT_H */
@@ -21,8 +21,8 @@
#include "port.h" #include "port.h"
#include SDL_INCLUDE(SDL.h) #include SDL_INCLUDE(SDL.h)
#include SDL_INCLUDE(SDL_image.h)
#include SDL_INCLUDE(SDL_byteorder.h) #include SDL_INCLUDE(SDL_byteorder.h)
#include SDL_IMAGE_INCLUDE(SDL_image.h)
#include "libs/graphics/gfxintrn.h" #include "libs/graphics/gfxintrn.h"
#include "libs/graphics/tfb_draw.h" #include "libs/graphics/tfb_draw.h"
+1 -1
View File
@@ -3,9 +3,9 @@
#include "port.h" #include "port.h"
#include "libs/uio.h" #include "libs/uio.h"
#include SDL_INCLUDE(SDL.h) #include SDL_INCLUDE(SDL.h)
#include SDL_INCLUDE(SDL_image.h)
#include SDL_INCLUDE(SDL_error.h) #include SDL_INCLUDE(SDL_error.h)
#include SDL_INCLUDE(SDL_rwops.h) #include SDL_INCLUDE(SDL_rwops.h)
#include SDL_IMAGE_INCLUDE(SDL_image.h)
#include "libs/misc.h" #include "libs/misc.h"
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>