Fixed so code will compile with SDL_config_minimal.h
authorSam Lantinga <slouken@libsdl.org>
Sat, 12 Mar 2011 13:21:57 -0800
changeset 548122dfc3958dc3
parent 5480 55a687c55676
child 5482 2c0477323626
Fixed so code will compile with SDL_config_minimal.h
include/SDL_config_minimal.h
include/SDL_stdinc.h
src/audio/pulseaudio/SDL_pulseaudio.c
src/thread/pthread/SDL_sysmutex.c
src/video/x11/SDL_x11clipboard.c
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11framebuffer.c
src/video/x11/SDL_x11keyboard.c
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11mouse.c
src/video/x11/SDL_x11shape.c
src/video/x11/SDL_x11touch.c
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_config_minimal.h	Fri Mar 11 18:38:29 2011 -0800
     1.2 +++ b/include/SDL_config_minimal.h	Sat Mar 12 13:21:57 2011 -0800
     1.3 @@ -31,19 +31,27 @@
     1.4   *  This is the minimal configuration that can be used to build SDL.
     1.5   */
     1.6  
     1.7 +#include <stddef.h>
     1.8  #include <stdarg.h>
     1.9  
    1.10  #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
    1.11 +typedef unsigned int size_t;
    1.12  typedef signed char int8_t;
    1.13  typedef unsigned char uint8_t;
    1.14  typedef signed short int16_t;
    1.15  typedef unsigned short uint16_t;
    1.16  typedef signed int int32_t;
    1.17  typedef unsigned int uint32_t;
    1.18 -typedef unsigned int size_t;
    1.19 +typedef signed long long int64_t;
    1.20 +typedef unsigned long long uint64_t;
    1.21  typedef unsigned long uintptr_t;
    1.22  #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
    1.23  
    1.24 +#define SDL_HAS_64BIT_TYPE
    1.25 +#ifdef __GNUC__
    1.26 +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
    1.27 +#endif
    1.28 +
    1.29  /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
    1.30  #define SDL_AUDIO_DRIVER_DUMMY	1
    1.31  
     2.1 --- a/include/SDL_stdinc.h	Fri Mar 11 18:38:29 2011 -0800
     2.2 +++ b/include/SDL_stdinc.h	Sat Mar 12 13:21:57 2011 -0800
     2.3 @@ -174,10 +174,7 @@
     2.4  SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
     2.5  SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
     2.6  SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
     2.7 -#if !defined(__NINTENDODS__) && !defined(__ANDROID__)
     2.8 -/* TODO: figure out why the following happens:
     2.9 - include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
    2.10 - include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
    2.11 +#ifdef SDL_HAS_64BIT_TYPE
    2.12  SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
    2.13  SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
    2.14  #endif
     3.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c	Fri Mar 11 18:38:29 2011 -0800
     3.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Sat Mar 12 13:21:57 2011 -0800
     3.3 @@ -26,8 +26,9 @@
     3.4     was the cleanest way to move it to 1.3. The 1.2 target was written by
     3.5     St├ęphan Kochen: stephan .a.t. kochen.nl
     3.6  */
     3.7 +#include "SDL_config.h"
     3.8  
     3.9 -#include "SDL_config.h"
    3.10 +#if SDL_AUDIO_DRIVER_PULSEAUDIO
    3.11  
    3.12  /* Allow access to a raw mixing buffer */
    3.13  
    3.14 @@ -505,4 +506,6 @@
    3.15      PULSEAUDIO_DRIVER_NAME, "PulseAudio", PULSEAUDIO_Init, 0
    3.16  };
    3.17  
    3.18 +#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO */
    3.19 +
    3.20  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/thread/pthread/SDL_sysmutex.c	Fri Mar 11 18:38:29 2011 -0800
     4.2 +++ b/src/thread/pthread/SDL_sysmutex.c	Sat Mar 12 13:21:57 2011 -0800
     4.3 @@ -28,7 +28,7 @@
     4.4  
     4.5  #if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \
     4.6      !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
     4.7 -#define FAKE_RECURSIVE_MUTEX
     4.8 +#define FAKE_RECURSIVE_MUTEX 1
     4.9  #endif
    4.10  
    4.11  struct SDL_mutex
     5.1 --- a/src/video/x11/SDL_x11clipboard.c	Fri Mar 11 18:38:29 2011 -0800
     5.2 +++ b/src/video/x11/SDL_x11clipboard.c	Sat Mar 12 13:21:57 2011 -0800
     5.3 @@ -21,6 +21,8 @@
     5.4  */
     5.5  #include "SDL_config.h"
     5.6  
     5.7 +#if SDL_VIDEO_DRIVER_X11
     5.8 +
     5.9  #include <limits.h> /* For INT_MAX */
    5.10  
    5.11  #include "SDL_events.h"
    5.12 @@ -149,4 +151,6 @@
    5.13      return retval;
    5.14  }
    5.15  
    5.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
    5.17 +
    5.18  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/video/x11/SDL_x11dyn.c	Fri Mar 11 18:38:29 2011 -0800
     6.2 +++ b/src/video/x11/SDL_x11dyn.c	Sat Mar 12 13:21:57 2011 -0800
     6.3 @@ -21,6 +21,8 @@
     6.4  */
     6.5  #include "SDL_config.h"
     6.6  
     6.7 +#if SDL_VIDEO_DRIVER_X11
     6.8 +
     6.9  #define DEBUG_DYNAMIC_X11 0
    6.10  
    6.11  #include "SDL_x11dyn.h"
    6.12 @@ -206,4 +208,6 @@
    6.13      return rc;
    6.14  }
    6.15  
    6.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
    6.17 +
    6.18  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/video/x11/SDL_x11events.c	Fri Mar 11 18:38:29 2011 -0800
     7.2 +++ b/src/video/x11/SDL_x11events.c	Sat Mar 12 13:21:57 2011 -0800
     7.3 @@ -21,6 +21,8 @@
     7.4  */
     7.5  #include "SDL_config.h"
     7.6  
     7.7 +#if SDL_VIDEO_DRIVER_X11
     7.8 +
     7.9  #include <sys/types.h>
    7.10  #include <sys/time.h>
    7.11  #include <signal.h>
    7.12 @@ -637,4 +639,6 @@
    7.13  #endif
    7.14  }
    7.15  
    7.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
    7.17 +
    7.18  /* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/x11/SDL_x11framebuffer.c	Fri Mar 11 18:38:29 2011 -0800
     8.2 +++ b/src/video/x11/SDL_x11framebuffer.c	Sat Mar 12 13:21:57 2011 -0800
     8.3 @@ -21,6 +21,8 @@
     8.4  */
     8.5  #include "SDL_config.h"
     8.6  
     8.7 +#if SDL_VIDEO_DRIVER_X11
     8.8 +
     8.9  #include "SDL_x11video.h"
    8.10  #include "SDL_x11framebuffer.h"
    8.11  
    8.12 @@ -211,4 +213,6 @@
    8.13      }
    8.14  }
    8.15  
    8.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
    8.17 +
    8.18  /* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/x11/SDL_x11keyboard.c	Fri Mar 11 18:38:29 2011 -0800
     9.2 +++ b/src/video/x11/SDL_x11keyboard.c	Sat Mar 12 13:21:57 2011 -0800
     9.3 @@ -21,6 +21,8 @@
     9.4  */
     9.5  #include "SDL_config.h"
     9.6  
     9.7 +#if SDL_VIDEO_DRIVER_X11
     9.8 +
     9.9  #include "SDL_x11video.h"
    9.10  
    9.11  #include "../../events/SDL_keyboard_c.h"
    9.12 @@ -287,4 +289,6 @@
    9.13  {
    9.14  }
    9.15  
    9.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
    9.17 +
    9.18  /* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/video/x11/SDL_x11modes.c	Fri Mar 11 18:38:29 2011 -0800
    10.2 +++ b/src/video/x11/SDL_x11modes.c	Sat Mar 12 13:21:57 2011 -0800
    10.3 @@ -21,6 +21,8 @@
    10.4  */
    10.5  #include "SDL_config.h"
    10.6  
    10.7 +#if SDL_VIDEO_DRIVER_X11
    10.8 +
    10.9  #include "SDL_x11video.h"
   10.10  
   10.11  /*#define X11MODES_DEBUG*/
   10.12 @@ -715,4 +717,6 @@
   10.13  {
   10.14  }
   10.15  
   10.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
   10.17 +
   10.18  /* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/video/x11/SDL_x11mouse.c	Fri Mar 11 18:38:29 2011 -0800
    11.2 +++ b/src/video/x11/SDL_x11mouse.c	Sat Mar 12 13:21:57 2011 -0800
    11.3 @@ -21,6 +21,8 @@
    11.4  */
    11.5  #include "SDL_config.h"
    11.6  
    11.7 +#if SDL_VIDEO_DRIVER_X11
    11.8 +
    11.9  #include "SDL_assert.h"
   11.10  #include "SDL_x11video.h"
   11.11  #include "SDL_x11mouse.h"
   11.12 @@ -293,4 +295,6 @@
   11.13      X11_DestroyEmptyCursor();
   11.14  }
   11.15  
   11.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
   11.17 +
   11.18  /* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/x11/SDL_x11shape.c	Fri Mar 11 18:38:29 2011 -0800
    12.2 +++ b/src/video/x11/SDL_x11shape.c	Sat Mar 12 13:21:57 2011 -0800
    12.3 @@ -19,6 +19,9 @@
    12.4      Eli Gottlieb
    12.5      eligottlieb@gmail.com
    12.6  */
    12.7 +#include "SDL_config.h"
    12.8 +
    12.9 +#if SDL_VIDEO_DRIVER_X11
   12.10  
   12.11  #include "SDL_assert.h"
   12.12  #include "SDL_x11video.h"
   12.13 @@ -108,3 +111,6 @@
   12.14  
   12.15      return 0;
   12.16  }
   12.17 +
   12.18 +#endif /* SDL_VIDEO_DRIVER_X11 */
   12.19 +
    13.1 --- a/src/video/x11/SDL_x11touch.c	Fri Mar 11 18:38:29 2011 -0800
    13.2 +++ b/src/video/x11/SDL_x11touch.c	Sat Mar 12 13:21:57 2011 -0800
    13.3 @@ -20,6 +20,9 @@
    13.4      slouken@libsdl.org
    13.5  */
    13.6  #include "SDL_config.h"
    13.7 +
    13.8 +#if SDL_VIDEO_DRIVER_X11
    13.9 +
   13.10  #include "SDL_x11video.h"
   13.11  #include "SDL_x11touch.h"
   13.12  #include "../../events/SDL_touch_c.h"
   13.13 @@ -117,4 +120,6 @@
   13.14      SDL_TouchQuit();
   13.15  }
   13.16  
   13.17 +#endif /* SDL_VIDEO_DRIVER_X11 */
   13.18 +
   13.19  /* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/video/x11/SDL_x11video.c	Fri Mar 11 18:38:29 2011 -0800
    14.2 +++ b/src/video/x11/SDL_x11video.c	Sat Mar 12 13:21:57 2011 -0800
    14.3 @@ -21,6 +21,8 @@
    14.4  */
    14.5  #include "SDL_config.h"
    14.6  
    14.7 +#if SDL_VIDEO_DRIVER_X11
    14.8 +
    14.9  #include <unistd.h> /* For getpid() and readlink() */
   14.10  
   14.11  #include "SDL_video.h"
   14.12 @@ -390,4 +392,6 @@
   14.13      return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
   14.14  }
   14.15  
   14.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
   14.17 +
   14.18  /* vim: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/video/x11/SDL_x11window.c	Fri Mar 11 18:38:29 2011 -0800
    15.2 +++ b/src/video/x11/SDL_x11window.c	Sat Mar 12 13:21:57 2011 -0800
    15.3 @@ -21,6 +21,8 @@
    15.4  */
    15.5  #include "SDL_config.h"
    15.6  
    15.7 +#if SDL_VIDEO_DRIVER_X11
    15.8 +
    15.9  #include "../SDL_sysvideo.h"
   15.10  #include "../SDL_pixels_c.h"
   15.11  #include "../../events/SDL_keyboard_c.h"
   15.12 @@ -1084,4 +1086,6 @@
   15.13      }
   15.14  }
   15.15  
   15.16 +#endif /* SDL_VIDEO_DRIVER_X11 */
   15.17 +
   15.18  /* vi: set ts=4 sw=4 expandtab: */