From 1ea1a4bbf49bfc3b29bed5b8b3d67eed6628445d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 6 Feb 2006 08:46:14 +0000 Subject: [PATCH] A few fixes to get this building on Linux again --- include/SDL_config.h | 14 ++++++++++++++ src/audio/alsa/SDL_alsa_audio.c | 2 ++ src/stdlib/SDL_getenv.c | 3 +++ src/stdlib/SDL_qsort.c | 2 +- src/stdlib/SDL_stdlib.c | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/SDL_config.h b/include/SDL_config.h index 0297a13c4..f0c33183e 100644 --- a/include/SDL_config.h +++ b/include/SDL_config.h @@ -32,14 +32,26 @@ #ifdef HAVE_LIBC /* Various C library headers */ +#ifndef HAVE_CTYPE_H #define HAVE_CTYPE_H +#endif +#ifndef HAVE_STDIO_H #define HAVE_STDIO_H +#endif +#ifndef HAVE_STDLIB_H #define HAVE_STDLIB_H +#endif +#ifndef HAVE_MALLOC_H #define HAVE_MALLOC_H +#endif +#ifndef HAVE_STRING_H #define HAVE_STRING_H +#endif #if !defined(_WIN32_WCE) +#ifndef HAVE_SIGNAL_H #define HAVE_SIGNAL_H #endif +#endif /* !_WIN32_WCE */ /* Features provided by SDL_stdlib.h */ #if !defined(_WIN32) /* Don't use C runtime versions of these on Windows */ @@ -49,7 +61,9 @@ #define HAVE_MALLOC #define HAVE_REALLOC #define HAVE_FREE +#ifndef HAVE_ALLOCA #define HAVE_ALLOCA +#endif /*#define HAVE_QSORT*/ /* Features provided by SDL_string.h */ diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 4e6551e9f..9880e0071 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -43,8 +43,10 @@ #ifdef ALSA_DYNAMIC #ifdef USE_DLVSYM +#ifndef __USE_GNU #define __USE_GNU #endif +#endif #include #include "SDL_name.h" #include "SDL_loadso.h" diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index e3035a674..74f789175 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -23,6 +23,7 @@ #include "SDL_stdlib.h" #include "SDL_string.h" +#ifndef HAVE_GETENV #if defined(WIN32) && !defined(_WIN32_WCE) @@ -173,6 +174,8 @@ char *SDL_getenv(const char *name) #endif /* WIN32 */ +#endif /* !HAVE_GETENV */ + #ifdef TEST_MAIN #include diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 3e961601b..ffc0b9ca0 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -415,4 +415,4 @@ void SDL_qsort(void *base, size_t nmemb, size_t size, qsort_words(base,nmemb,compare); } -#endif /* !HAVE_QSORT */ \ No newline at end of file +#endif /* !HAVE_QSORT */ diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index 5cf40fb8d..cb255b688 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -67,4 +67,4 @@ void _aullshr() #endif /* MSC_VER */ -#endif /* !HAVE_LIBC */ \ No newline at end of file +#endif /* !HAVE_LIBC */