Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed SDL building with the minimal configuration

  • Loading branch information
slouken committed Jun 14, 2013
1 parent a8f0158 commit 1f43cfd729bdec2011f7294dc50682b218a684cf
@@ -16936,7 +16936,10 @@ SOURCES="$SOURCES $srcdir/src/audio/*.c"
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
SOURCES="$SOURCES $srcdir/src/events/*.c"
SOURCES="$SOURCES $srcdir/src/file/*.c"
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
SOURCES="$SOURCES $srcdir/src/libm/*.c"
SOURCES="$SOURCES $srcdir/src/power/*.c"
SOURCES="$SOURCES $srcdir/src/render/*.c"
SOURCES="$SOURCES $srcdir/src/render/*/*.c"
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
@@ -17016,8 +17019,6 @@ if test x$enable_joystick != xyes; then

$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h

else
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
fi
# Check whether --enable-haptic was given.
if test "${enable_haptic+set}" = set; then :
@@ -17030,8 +17031,6 @@ if test x$enable_haptic != xyes; then

$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h

else
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
fi
# Check whether --enable-power was given.
if test "${enable_power+set}" = set; then :
@@ -17044,8 +17043,6 @@ if test x$enable_power != xyes; then

$as_echo "#define SDL_POWER_DISABLED 1" >>confdefs.h

else
SOURCES="$SOURCES $srcdir/src/power/*.c"
fi
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
@@ -297,7 +297,10 @@ SOURCES="$SOURCES $srcdir/src/audio/*.c"
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
SOURCES="$SOURCES $srcdir/src/events/*.c"
SOURCES="$SOURCES $srcdir/src/file/*.c"
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
SOURCES="$SOURCES $srcdir/src/libm/*.c"
SOURCES="$SOURCES $srcdir/src/power/*.c"
SOURCES="$SOURCES $srcdir/src/render/*.c"
SOURCES="$SOURCES $srcdir/src/render/*/*.c"
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
@@ -342,24 +345,18 @@ AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes
, enable_joystick=yes)
if test x$enable_joystick != xyes; then
AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
else
SOURCES="$SOURCES $srcdir/src/joystick/*.c"
fi
AC_ARG_ENABLE(haptic,
AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
, enable_haptic=yes)
if test x$enable_haptic != xyes; then
AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
else
SOURCES="$SOURCES $srcdir/src/haptic/*.c"
fi
AC_ARG_ENABLE(power,
AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
, enable_power=yes)
if test x$enable_power != xyes; then
AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
else
SOURCES="$SOURCES $srcdir/src/power/*.c"
fi
AC_ARG_ENABLE(threads,
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
@@ -158,8 +158,9 @@
#undef HAVE_SEM_TIMEDWAIT

#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#endif /* HAVE_LIBC */

/* SDL internal assertion support */
@@ -30,10 +30,12 @@
* This is the minimal configuration that can be used to build SDL.
*/

#include <stddef.h>
#include <stdarg.h>
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1

#if !defined(_STDINT_H_) && !defined(_STDINT_H) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
#if defined(_MSC_VER) && (_MSC_VER < 1600)
/* Here are some reasonable defaults */
typedef unsigned int size_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
@@ -44,7 +46,9 @@ typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#endif /* if (stdint.h isn't available) */
#else
#define HAVE_STDINT_H 1
#endif /* Visual Studio 2008 */

#ifdef __GNUC__
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
@@ -359,7 +359,7 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t len)


extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
#if defined(__MACOSX__)
#if defined(__MACOSX__) && defined(HAVE_MEMCPY)
SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len)
{
/* We can count on memcpy existing on Mac OS X and being well-tuned. */
@@ -369,7 +369,9 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
__android_log_write(SDL_android_priority[priority], tag, message);
}
#elif defined(__APPLE__)
#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)
/* Technically we don't need SDL_VIDEO_DRIVER_COCOA, but that's where this function is defined for now.
*/
extern void SDL_NSLog(const char *text);
{
char *text;
@@ -611,7 +611,7 @@ SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state)

/* We ignore events if we don't have keyboard focus, except for button
* release. */
if (event.type == SDL_JOYBUTTONDOWN && SDL_PrivateJoystickShouldIgnoreEvent()) {
if (state == SDL_PRESSED && SDL_PrivateJoystickShouldIgnoreEvent()) {
return 0;
}

@@ -32,7 +32,7 @@
SDL_sem *
SDL_CreateSemaphore(Uint32 initial_value)
{
SDL_SetError("SDL not configured with thread support");
SDL_SetError("SDL not built with thread support");
return (SDL_sem *) 0;
}

@@ -44,19 +44,19 @@ SDL_DestroySemaphore(SDL_sem * sem)
int
SDL_SemTryWait(SDL_sem * sem)
{
return SDL_SetError("SDL not configured with thread support");
return SDL_SetError("SDL not built with thread support");
}

int
SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
{
return SDL_SetError("SDL not configured with thread support");
return SDL_SetError("SDL not built with thread support");
}

int
SDL_SemWait(SDL_sem * sem)
{
return SDL_SetError("SDL not configured with thread support");
return SDL_SetError("SDL not built with thread support");
}

Uint32
@@ -68,7 +68,7 @@ SDL_SemValue(SDL_sem * sem)
int
SDL_SemPost(SDL_sem * sem)
{
return SDL_SetError("SDL not configured with thread support");
return SDL_SetError("SDL not built with thread support");
}

#else
@@ -63,7 +63,7 @@ report_power(void)
int
main(int argc, char *argv[])
{
if (SDL_Init(SDL_INIT_VIDEO) == -1) {
if (SDL_Init(0) == -1) {
fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
return 1;
}

0 comments on commit 1f43cfd

Please sign in to comment.