Lots of fixes importing SDL source wholesale into a new iOS project
authorSam Lantinga <slouken@libsdl.org>
Mon, 31 Oct 2011 05:56:58 -0400
changeset 604435448a5ea044
parent 6043 46d78e48ae8b
child 6045 b8e995dab018
Lots of fixes importing SDL source wholesale into a new iOS project
include/SDL_config.h.in
include/SDL_opengl.h
src/SDL_error_c.h
src/audio/alsa/SDL_alsa_audio.c
src/audio/android/SDL_androidaudio.c
src/audio/arts/SDL_artsaudio.c
src/audio/baudio/SDL_beaudio.cc
src/audio/bsd/SDL_bsdaudio.c
src/audio/directsound/SDL_directsound.c
src/audio/disk/SDL_diskaudio.c
src/audio/dsp/SDL_dspaudio.c
src/audio/esd/SDL_esdaudio.c
src/audio/fusionsound/SDL_fsaudio.c
src/audio/nas/SDL_nasaudio.c
src/audio/nds/SDL_ndsaudio.c
src/audio/paudio/SDL_paudio.c
src/audio/pulseaudio/SDL_pulseaudio.c
src/audio/qsa/SDL_qsa_audio.c
src/audio/sun/SDL_sunaudio.c
src/audio/ums/SDL_umsaudio.c
src/audio/ums/SDL_umsaudio.h
src/audio/winmm/SDL_winmm.c
src/audio/xaudio2/SDL_xaudio2.c
src/core/android/SDL_android.cpp
src/core/windows/SDL_windows.c
src/events/SDL_gesture.c
src/events/SDL_keyboard.c
src/events/SDL_touch.c
src/libm/e_atan2.c
src/libm/e_log.c
src/libm/e_pow.c
src/libm/e_rem_pio2.c
src/libm/e_sqrt.c
src/libm/k_cos.c
src/libm/k_rem_pio2.c
src/libm/k_sin.c
src/libm/math.h
src/libm/math_libm.h
src/libm/s_atan.c
src/libm/s_copysign.c
src/libm/s_cos.c
src/libm/s_fabs.c
src/libm/s_floor.c
src/libm/s_scalbn.c
src/libm/s_sin.c
src/main/android/SDL_android_main.cpp
src/main/beos/SDL_BeApp.cc
src/main/windows/SDL_windows_main.c
src/power/beos/SDL_syspower.c
src/power/linux/SDL_syspower.c
src/power/macosx/SDL_syspower.c
src/power/nds/SDL_syspower.c
src/power/uikit/SDL_syspower.h
src/power/uikit/SDL_syspower.m
src/power/windows/SDL_syspower.c
src/render/SDL_render.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/render/software/SDL_render_sw.c
src/stdlib/SDL_string.c
src/thread/SDL_thread.c
src/thread/SDL_thread_c.h
src/thread/beos/SDL_syssem.c
src/thread/beos/SDL_systhread.c
src/thread/irix/SDL_syssem.c
src/thread/irix/SDL_systhread.c
src/thread/irix/SDL_systhread_c.h
src/thread/nds/SDL_systhread.c
src/thread/windows/SDL_sysmutex.c
src/thread/windows/SDL_syssem.c
src/thread/windows/SDL_systhread.c
src/thread/windows/win_ce_semaphore.c
src/video/SDL_rect.c
src/video/SDL_shape.c
src/video/SDL_video.c
src/video/android/SDL_androidevents.c
src/video/android/SDL_androidgl.c
src/video/android/SDL_androidkeyboard.c
src/video/android/SDL_androidtouch.c
src/video/android/SDL_androidvideo.c
src/video/android/SDL_androidwindow.c
src/video/bwindow/SDL_bclipboard.cc
src/video/bwindow/SDL_bevents.cc
src/video/bwindow/SDL_bframebuffer.cc
src/video/bwindow/SDL_bkeyboard.cc
src/video/bwindow/SDL_bmodes.cc
src/video/bwindow/SDL_bopengl.cc
src/video/bwindow/SDL_bvideo.cc
src/video/bwindow/SDL_bwindow.cc
src/video/cocoa/SDL_cocoaclipboard.m
src/video/cocoa/SDL_cocoaevents.m
src/video/cocoa/SDL_cocoakeyboard.m
src/video/cocoa/SDL_cocoamodes.m
src/video/cocoa/SDL_cocoamouse.m
src/video/cocoa/SDL_cocoaopengl.m
src/video/cocoa/SDL_cocoashape.m
src/video/cocoa/SDL_cocoavideo.m
src/video/cocoa/SDL_cocoawindow.m
src/video/directfb/SDL_DirectFB_WM.c
src/video/directfb/SDL_DirectFB_dyn.c
src/video/directfb/SDL_DirectFB_events.c
src/video/directfb/SDL_DirectFB_modes.c
src/video/directfb/SDL_DirectFB_mouse.c
src/video/directfb/SDL_DirectFB_opengl.c
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_shape.c
src/video/directfb/SDL_DirectFB_video.c
src/video/directfb/SDL_DirectFB_window.c
src/video/dummy/SDL_nullevents.c
src/video/dummy/SDL_nullframebuffer.c
src/video/dummy/SDL_nullvideo.c
src/video/nds/SDL_ndsevents.c
src/video/nds/SDL_ndsvideo.c
src/video/nds/SDL_ndswindow.c
src/video/pandora/SDL_pandora.c
src/video/pandora/SDL_pandora_events.c
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitevents.m
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitopenglview.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitview.m
src/video/uikit/SDL_uikitviewcontroller.m
src/video/uikit/SDL_uikitwindow.m
src/video/windows/SDL_windowsclipboard.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsframebuffer.c
src/video/windows/SDL_windowskeyboard.c
src/video/windows/SDL_windowsmodes.c
src/video/windows/SDL_windowsmouse.c
src/video/windows/SDL_windowsopengl.c
src/video/windows/SDL_windowsshape.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowswindow.c
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11opengles.c
src/video/x11/imKStoUCS.c
     1.1 --- a/include/SDL_config.h.in	Mon Oct 31 03:06:32 2011 -0400
     1.2 +++ b/include/SDL_config.h.in	Mon Oct 31 05:56:58 2011 -0400
     1.3 @@ -233,7 +233,6 @@
     1.4  #undef SDL_THREAD_PTHREAD
     1.5  #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
     1.6  #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
     1.7 -#undef SDL_THREAD_SPROC
     1.8  #undef SDL_THREAD_WINDOWS
     1.9  
    1.10  /* Enable various timer systems */
     2.1 --- a/include/SDL_opengl.h	Mon Oct 31 03:06:32 2011 -0400
     2.2 +++ b/include/SDL_opengl.h	Mon Oct 31 05:56:58 2011 -0400
     2.3 @@ -30,6 +30,8 @@
     2.4  
     2.5  #include "SDL_config.h"
     2.6  
     2.7 +#ifndef __IPHONEOS__
     2.8 +
     2.9  #ifdef __WIN32__
    2.10  #define WIN32_LEAN_AND_MEAN
    2.11  #ifndef NOMINMAX
    2.12 @@ -11123,6 +11125,8 @@
    2.13  /* *INDENT-ON* */
    2.14  #endif /* NO_SDL_GLEXT */
    2.15  
    2.16 +#endif /* !__IPHONEOS__ */
    2.17 +
    2.18  #endif /* _SDL_opengl_h */
    2.19  
    2.20  /* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/SDL_error_c.h	Mon Oct 31 03:06:32 2011 -0400
     3.2 +++ b/src/SDL_error_c.h	Mon Oct 31 05:56:58 2011 -0400
     3.3 @@ -56,6 +56,9 @@
     3.4      } args[ERR_MAX_ARGS];
     3.5  } SDL_error;
     3.6  
     3.7 +/* Defined in SDL_thread.c */
     3.8 +extern SDL_error *SDL_GetErrBuf(void);
     3.9 +
    3.10  #endif /* _SDL_error_c_h */
    3.11  
    3.12  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 31 03:06:32 2011 -0400
     4.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 31 05:56:58 2011 -0400
     4.3 @@ -20,6 +20,8 @@
     4.4  */
     4.5  #include "SDL_config.h"
     4.6  
     4.7 +#if SDL_AUDIO_DRIVER_ALSA
     4.8 +
     4.9  /* Allow access to a raw mixing buffer */
    4.10  
    4.11  #include <sys/types.h>
    4.12 @@ -33,7 +35,7 @@
    4.13  #include "../SDL_audio_c.h"
    4.14  #include "SDL_alsa_audio.h"
    4.15  
    4.16 -#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.17 +#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.18  #include "SDL_loadso.h"
    4.19  #endif
    4.20  
    4.21 @@ -84,7 +86,7 @@
    4.22  static int (*ALSA_snd_pcm_sw_params_set_avail_min)
    4.23    (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
    4.24  
    4.25 -#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.26 +#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.27  #define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof
    4.28  #define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof
    4.29  
    4.30 @@ -147,7 +149,7 @@
    4.31  
    4.32  #undef SDL_ALSA_SYM
    4.33  
    4.34 -#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.35 +#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
    4.36  
    4.37  static void
    4.38  UnloadALSALibrary(void)
    4.39 @@ -693,4 +695,6 @@
    4.40      "alsa", "ALSA PCM audio", ALSA_Init, 0
    4.41  };
    4.42  
    4.43 +#endif /* SDL_AUDIO_DRIVER_ALSA */
    4.44 +
    4.45  /* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/audio/android/SDL_androidaudio.c	Mon Oct 31 03:06:32 2011 -0400
     5.2 +++ b/src/audio/android/SDL_androidaudio.c	Mon Oct 31 05:56:58 2011 -0400
     5.3 @@ -20,6 +20,8 @@
     5.4  */
     5.5  #include "SDL_config.h"
     5.6  
     5.7 +#if SDL_AUDIO_DRIVER_ANDROID
     5.8 +
     5.9  /* Output audio to Android */
    5.10  
    5.11  #include "SDL_audio.h"
    5.12 @@ -154,4 +156,6 @@
    5.13  	SDL_RunAudio(audioDevice);
    5.14  }
    5.15  
    5.16 +#endif /* SDL_AUDIO_DRIVER_ANDROID */
    5.17 +
    5.18  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/audio/arts/SDL_artsaudio.c	Mon Oct 31 03:06:32 2011 -0400
     6.2 +++ b/src/audio/arts/SDL_artsaudio.c	Mon Oct 31 05:56:58 2011 -0400
     6.3 @@ -20,6 +20,8 @@
     6.4  */
     6.5  #include "SDL_config.h"
     6.6  
     6.7 +#if SDL_AUDIO_DRIVER_ARTS
     6.8 +
     6.9  /* Allow access to a raw mixing buffer */
    6.10  
    6.11  #ifdef HAVE_SIGNAL_H
    6.12 @@ -34,14 +36,14 @@
    6.13  #include "../SDL_audio_c.h"
    6.14  #include "SDL_artsaudio.h"
    6.15  
    6.16 -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    6.17 +#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    6.18  #include "SDL_name.h"
    6.19  #include "SDL_loadso.h"
    6.20  #else
    6.21  #define SDL_NAME(X)	X
    6.22  #endif
    6.23  
    6.24 -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    6.25 +#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    6.26  
    6.27  static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
    6.28  static void *arts_handle = NULL;
    6.29 @@ -372,4 +374,6 @@
    6.30      "arts", "Analog RealTime Synthesizer", ARTS_Init, 0
    6.31  };
    6.32  
    6.33 +#endif /* SDL_AUDIO_DRIVER_ARTS */
    6.34 +
    6.35  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/audio/baudio/SDL_beaudio.cc	Mon Oct 31 03:06:32 2011 -0400
     7.2 +++ b/src/audio/baudio/SDL_beaudio.cc	Mon Oct 31 05:56:58 2011 -0400
     7.3 @@ -20,6 +20,8 @@
     7.4  */
     7.5  #include "SDL_config.h"
     7.6  
     7.7 +#if SDL_AUDIO_DRIVER_BEOSAUDIO
     7.8 +
     7.9  /* Allow access to the audio stream on BeOS */
    7.10  
    7.11  #include <SoundPlayer.h>
    7.12 @@ -214,4 +216,6 @@
    7.13      "baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0
    7.14  };
    7.15  
    7.16 +#endif /* SDL_AUDIO_DRIVER_BEOSAUDIO */
    7.17 +
    7.18  /* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/audio/bsd/SDL_bsdaudio.c	Mon Oct 31 03:06:32 2011 -0400
     8.2 +++ b/src/audio/bsd/SDL_bsdaudio.c	Mon Oct 31 05:56:58 2011 -0400
     8.3 @@ -20,6 +20,8 @@
     8.4  */
     8.5  #include "SDL_config.h"
     8.6  
     8.7 +#if SDL_AUDIO_DRIVER_BSD
     8.8 +
     8.9  /*
    8.10   * Driver for native OpenBSD/NetBSD audio(4).
    8.11   * vedge@vedge.com.ar.
    8.12 @@ -364,4 +366,6 @@
    8.13      "bsd", "BSD audio", BSDAUDIO_Init, 0
    8.14  };
    8.15  
    8.16 +#endif /* SDL_AUDIO_DRIVER_BSD */
    8.17 +
    8.18  /* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/audio/directsound/SDL_directsound.c	Mon Oct 31 03:06:32 2011 -0400
     9.2 +++ b/src/audio/directsound/SDL_directsound.c	Mon Oct 31 05:56:58 2011 -0400
     9.3 @@ -20,6 +20,8 @@
     9.4  */
     9.5  #include "SDL_config.h"
     9.6  
     9.7 +#if SDL_AUDIO_DRIVER_DSOUND
     9.8 +
     9.9  /* Allow access to a raw mixing buffer */
    9.10  
    9.11  #include "SDL_timer.h"
    9.12 @@ -549,4 +551,6 @@
    9.13      "directsound", "DirectSound", DSOUND_Init, 0
    9.14  };
    9.15  
    9.16 +#endif /* SDL_AUDIO_DRIVER_DSOUND */
    9.17 +
    9.18  /* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/audio/disk/SDL_diskaudio.c	Mon Oct 31 03:06:32 2011 -0400
    10.2 +++ b/src/audio/disk/SDL_diskaudio.c	Mon Oct 31 05:56:58 2011 -0400
    10.3 @@ -20,6 +20,8 @@
    10.4  */
    10.5  #include "SDL_config.h"
    10.6  
    10.7 +#if SDL_AUDIO_DRIVER_DISK
    10.8 +
    10.9  /* Output raw audio data to a file. */
   10.10  
   10.11  #if HAVE_STDIO_H
   10.12 @@ -159,4 +161,6 @@
   10.13      "disk", "direct-to-disk audio", DISKAUD_Init, 1
   10.14  };
   10.15  
   10.16 +#endif /* SDL_AUDIO_DRIVER_DISK */
   10.17 +
   10.18  /* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/audio/dsp/SDL_dspaudio.c	Mon Oct 31 03:06:32 2011 -0400
    11.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Mon Oct 31 05:56:58 2011 -0400
    11.3 @@ -20,6 +20,8 @@
    11.4  */
    11.5  #include "SDL_config.h"
    11.6  
    11.7 +#if SDL_AUDIO_DRIVER_OSS
    11.8 +
    11.9  /* Allow access to a raw mixing buffer */
   11.10  
   11.11  #include <stdio.h>              /* For perror() */
   11.12 @@ -312,4 +314,6 @@
   11.13      "dsp", "OSS /dev/dsp standard audio", DSP_Init, 0
   11.14  };
   11.15  
   11.16 +#endif /* SDL_AUDIO_DRIVER_OSS */
   11.17 +
   11.18  /* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/audio/esd/SDL_esdaudio.c	Mon Oct 31 03:06:32 2011 -0400
    12.2 +++ b/src/audio/esd/SDL_esdaudio.c	Mon Oct 31 05:56:58 2011 -0400
    12.3 @@ -20,6 +20,8 @@
    12.4  */
    12.5  #include "SDL_config.h"
    12.6  
    12.7 +#if SDL_AUDIO_DRIVER_ESD
    12.8 +
    12.9  /* Allow access to an ESD network stream mixing buffer */
   12.10  
   12.11  #include <sys/types.h>
   12.12 @@ -34,14 +36,14 @@
   12.13  #include "../SDL_audio_c.h"
   12.14  #include "SDL_esdaudio.h"
   12.15  
   12.16 -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
   12.17 +#if SDL_AUDIO_DRIVER_ESD_DYNAMIC
   12.18  #include "SDL_name.h"
   12.19  #include "SDL_loadso.h"
   12.20  #else
   12.21  #define SDL_NAME(X)	X
   12.22  #endif
   12.23  
   12.24 -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
   12.25 +#if SDL_AUDIO_DRIVER_ESD_DYNAMIC
   12.26  
   12.27  static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
   12.28  static void *esd_handle = NULL;
   12.29 @@ -345,4 +347,6 @@
   12.30      "esd", "Enlightened Sound Daemon", ESD_Init, 0
   12.31  };
   12.32  
   12.33 +#endif /* SDL_AUDIO_DRIVER_ESD */
   12.34 +
   12.35  /* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/audio/fusionsound/SDL_fsaudio.c	Mon Oct 31 03:06:32 2011 -0400
    13.2 +++ b/src/audio/fusionsound/SDL_fsaudio.c	Mon Oct 31 05:56:58 2011 -0400
    13.3 @@ -20,6 +20,8 @@
    13.4  */
    13.5  #include "SDL_config.h"
    13.6  
    13.7 +#if SDL_AUDIO_DRIVER_FUSIONSOUND
    13.8 +
    13.9  /* Allow access to a raw mixing buffer */
   13.10  
   13.11  #ifdef HAVE_SIGNAL_H
   13.12 @@ -37,7 +39,7 @@
   13.13  
   13.14  //#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so"
   13.15  
   13.16 -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
   13.17 +#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
   13.18  #include "SDL_name.h"
   13.19  #include "SDL_loadso.h"
   13.20  #else
   13.21 @@ -51,7 +53,7 @@
   13.22  /* Buffers to use - more than 2 gives a lot of latency */
   13.23  #define FUSION_BUFFERS				(2)
   13.24  
   13.25 -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
   13.26 +#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
   13.27  
   13.28  static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC;
   13.29  static void *fs_handle = NULL;
   13.30 @@ -345,4 +347,6 @@
   13.31      "fusionsound", "FusionSound", SDL_FS_Init, 0
   13.32  };
   13.33  
   13.34 +#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */
   13.35 +
   13.36  /* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/audio/nas/SDL_nasaudio.c	Mon Oct 31 03:06:32 2011 -0400
    14.2 +++ b/src/audio/nas/SDL_nasaudio.c	Mon Oct 31 05:56:58 2011 -0400
    14.3 @@ -20,6 +20,8 @@
    14.4  */
    14.5  #include "SDL_config.h"
    14.6  
    14.7 +#if SDL_AUDIO_DRIVER_NAS
    14.8 +
    14.9  /* Allow access to a raw mixing buffer */
   14.10  
   14.11  #include <signal.h>
   14.12 @@ -50,7 +52,7 @@
   14.13    (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer);
   14.14  
   14.15  
   14.16 -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
   14.17 +#if SDL_AUDIO_DRIVER_NAS_DYNAMIC
   14.18  
   14.19  static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
   14.20  static void *nas_handle = NULL;
   14.21 @@ -89,7 +91,7 @@
   14.22  
   14.23  #undef SDL_NAS_SYM
   14.24  
   14.25 -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
   14.26 +#if SDL_AUDIO_DRIVER_NAS_DYNAMIC
   14.27  
   14.28  static void
   14.29  UnloadNASLibrary(void)
   14.30 @@ -397,4 +399,6 @@
   14.31      "nas", "Network Audio System", NAS_Init, 0
   14.32  };
   14.33  
   14.34 +#endif /* SDL_AUDIO_DRIVER_NAS */
   14.35 +
   14.36  /* vi: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/audio/nds/SDL_ndsaudio.c	Mon Oct 31 03:06:32 2011 -0400
    15.2 +++ b/src/audio/nds/SDL_ndsaudio.c	Mon Oct 31 05:56:58 2011 -0400
    15.3 @@ -20,6 +20,8 @@
    15.4  */
    15.5  #include "SDL_config.h"
    15.6  
    15.7 +#if SDL_AUDIO_DRIVER_NDS
    15.8 +
    15.9  /* Output audio to NDS */
   15.10  
   15.11  #include <nds.h>
   15.12 @@ -122,4 +124,6 @@
   15.13      "nds", "SDL NDS audio driver", NDSAUD_Init, 0       /*1? */
   15.14  };
   15.15  
   15.16 +#endif /* SDL_AUDIO_DRIVER_NDS */
   15.17 +
   15.18  /* vi: set ts=4 sw=4 expandtab: */
    16.1 --- a/src/audio/paudio/SDL_paudio.c	Mon Oct 31 03:06:32 2011 -0400
    16.2 +++ b/src/audio/paudio/SDL_paudio.c	Mon Oct 31 05:56:58 2011 -0400
    16.3 @@ -20,6 +20,8 @@
    16.4  */
    16.5  #include "SDL_config.h"
    16.6  
    16.7 +#if SDL_AUDIO_DRIVER_PAUDIO
    16.8 +
    16.9  /* Allow access to a raw mixing buffer */
   16.10  
   16.11  #include <errno.h>
   16.12 @@ -545,4 +547,6 @@
   16.13      "paud", "AIX Paudio", PAUDIO_Init, 0
   16.14  };
   16.15  
   16.16 +#endif /* SDL_AUDIO_DRIVER_PAUDIO */
   16.17 +
   16.18  /* vi: set ts=4 sw=4 expandtab: */
    17.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c	Mon Oct 31 03:06:32 2011 -0400
    17.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Mon Oct 31 05:56:58 2011 -0400
    17.3 @@ -106,7 +106,7 @@
    17.4  static int load_pulseaudio_syms(void);
    17.5  
    17.6  
    17.7 -#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
    17.8 +#if SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
    17.9  
   17.10  static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC;
   17.11  static void *pulseaudio_handle = NULL;
    18.1 --- a/src/audio/qsa/SDL_qsa_audio.c	Mon Oct 31 03:06:32 2011 -0400
    18.2 +++ b/src/audio/qsa/SDL_qsa_audio.c	Mon Oct 31 05:56:58 2011 -0400
    18.3 @@ -21,6 +21,8 @@
    18.4  
    18.5  #include "SDL_config.h"
    18.6  
    18.7 +#if SDL_AUDIO_DRIVER_QSA
    18.8 +
    18.9  #include <errno.h>
   18.10  #include <unistd.h>
   18.11  #include <fcntl.h>
   18.12 @@ -863,4 +865,6 @@
   18.13      "qsa", "QNX QSA Audio", QSA_Init, 0
   18.14  };
   18.15  
   18.16 +#endif /* SDL_AUDIO_DRIVER_QSA */
   18.17 +
   18.18  /* vi: set ts=4 sw=4 expandtab: */
    19.1 --- a/src/audio/sun/SDL_sunaudio.c	Mon Oct 31 03:06:32 2011 -0400
    19.2 +++ b/src/audio/sun/SDL_sunaudio.c	Mon Oct 31 05:56:58 2011 -0400
    19.3 @@ -1,8 +1,3 @@
    19.4 -/* I'm gambling no one uses this audio backend...we'll see who emails.  :)  */
    19.5 -#error this code has not been updated for SDL 1.3.
    19.6 -#error if no one emails icculus at icculus.org and tells him that this
    19.7 -#error  code is needed, this audio backend will eventually be removed from SDL.
    19.8 -
    19.9  /*
   19.10    Simple DirectMedia Layer
   19.11    Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
   19.12 @@ -25,6 +20,13 @@
   19.13  */
   19.14  #include "SDL_config.h"
   19.15  
   19.16 +#if SDL_AUDIO_DRIVER_SUNAUDIO
   19.17 +
   19.18 +/* I'm gambling no one uses this audio backend...we'll see who emails.  :)  */
   19.19 +#error this code has not been updated for SDL 1.3.
   19.20 +#error if no one emails icculus at icculus.org and tells him that this
   19.21 +#error  code is needed, this audio backend will eventually be removed from SDL.
   19.22 +
   19.23  /* Allow access to a raw mixing buffer */
   19.24  
   19.25  #include <fcntl.h>
   19.26 @@ -450,4 +452,6 @@
   19.27      return (mask & sample);
   19.28  }
   19.29  
   19.30 +#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
   19.31 +
   19.32  /* vi: set ts=4 sw=4 expandtab: */
    20.1 --- a/src/audio/ums/SDL_umsaudio.c	Mon Oct 31 03:06:32 2011 -0400
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,556 +0,0 @@
    20.4 -/* I'm gambling no one uses this audio backend...we'll see who emails.  :)  */
    20.5 -#error this code has not been updated for SDL 1.3.
    20.6 -#error if no one emails icculus at icculus.org and tells him that this
    20.7 -#error  code is needed, this audio backend will eventually be removed from SDL.
    20.8 -
    20.9 -/*
   20.10 -  Simple DirectMedia Layer
   20.11 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
   20.12 -
   20.13 -  This software is provided 'as-is', without any express or implied
   20.14 -  warranty.  In no event will the authors be held liable for any damages
   20.15 -  arising from the use of this software.
   20.16 -
   20.17 -  Permission is granted to anyone to use this software for any purpose,
   20.18 -  including commercial applications, and to alter it and redistribute it
   20.19 -  freely, subject to the following restrictions:
   20.20 -
   20.21 -  1. The origin of this software must not be misrepresented; you must not
   20.22 -     claim that you wrote the original software. If you use this software
   20.23 -     in a product, an acknowledgment in the product documentation would be
   20.24 -     appreciated but is not required.
   20.25 -  2. Altered source versions must be plainly marked as such, and must not be
   20.26 -     misrepresented as being the original software.
   20.27 -  3. This notice may not be removed or altered from any source distribution.
   20.28 -*/
   20.29 -#include "SDL_config.h"
   20.30 -
   20.31 -/* Allow access to a raw mixing buffer */
   20.32 -
   20.33 -#include <errno.h>
   20.34 -#include <unistd.h>
   20.35 -#include <fcntl.h>
   20.36 -#include <sys/types.h>
   20.37 -#include <sys/time.h>
   20.38 -#include <sys/ioctl.h>
   20.39 -#include <sys/stat.h>
   20.40 -#include <sys/mman.h>
   20.41 -
   20.42 -#include "SDL_audio.h"
   20.43 -#include "../SDL_audio_c.h"
   20.44 -#include "SDL_umsaudio.h"
   20.45 -
   20.46 -#define DEBUG_AUDIO 1
   20.47 -
   20.48 -/* Audio driver functions */
   20.49 -static int UMS_OpenAudio(_THIS, SDL_AudioSpec * spec);
   20.50 -static void UMS_PlayAudio(_THIS);
   20.51 -static Uint8 *UMS_GetAudioBuf(_THIS);
   20.52 -static void UMS_CloseAudio(_THIS);
   20.53 -
   20.54 -static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode,
   20.55 -                                         long flags);
   20.56 -static UMSAudioDevice_ReturnCode UADClose(_THIS);
   20.57 -static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long *bits);
   20.58 -static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits);
   20.59 -static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate,
   20.60 -                                                  long *set_rate);
   20.61 -static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order);
   20.62 -static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt);
   20.63 -static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt);
   20.64 -static UMSAudioDevice_ReturnCode UADInitialize(_THIS);
   20.65 -static UMSAudioDevice_ReturnCode UADStart(_THIS);
   20.66 -static UMSAudioDevice_ReturnCode UADStop(_THIS);
   20.67 -static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS,
   20.68 -                                                  UMSAudioTypes_TimeFormat
   20.69 -                                                  fmt);
   20.70 -static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long *buff_size);
   20.71 -static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long *buff_size);
   20.72 -static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long *buff_size);
   20.73 -static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes,
   20.74 -                                                     long *bytes_ret);
   20.75 -static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume);
   20.76 -static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance);
   20.77 -static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels);
   20.78 -static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block);
   20.79 -static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output,
   20.80 -                                                 long *left_gain,
   20.81 -                                                 long *right_gain);
   20.82 -static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer * buff,
   20.83 -                                          long samples,
   20.84 -                                          long *samples_written);
   20.85 -
   20.86 -/* Audio driver bootstrap functions */
   20.87 -static int
   20.88 -Audio_Available(void)
   20.89 -{
   20.90 -    return 1;
   20.91 -}
   20.92 -
   20.93 -static void
   20.94 -Audio_DeleteDevice(_THIS)
   20.95 -{
   20.96 -    if (this->hidden->playbuf._buffer)
   20.97 -        SDL_free(this->hidden->playbuf._buffer);
   20.98 -    if (this->hidden->fillbuf._buffer)
   20.99 -        SDL_free(this->hidden->fillbuf._buffer);
  20.100 -    _somFree(this->hidden->umsdev);
  20.101 -    SDL_free(this->hidden);
  20.102 -    SDL_free(this);
  20.103 -}
  20.104 -
  20.105 -static SDL_AudioDevice *
  20.106 -Audio_CreateDevice(int devindex)
  20.107 -{
  20.108 -    SDL_AudioDevice *this;
  20.109 -
  20.110 -    /*
  20.111 -     * Allocate and initialize management storage and private management
  20.112 -     * storage for this SDL-using library.
  20.113 -     */
  20.114 -    this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
  20.115 -    if (this) {
  20.116 -        SDL_memset(this, 0, (sizeof *this));
  20.117 -        this->hidden = (struct SDL_PrivateAudioData *)
  20.118 -            SDL_malloc((sizeof *this->hidden));
  20.119 -    }
  20.120 -    if ((this == NULL) || (this->hidden == NULL)) {
  20.121 -        SDL_OutOfMemory();
  20.122 -        if (this) {
  20.123 -            SDL_free(this);
  20.124 -        }
  20.125 -        return (0);
  20.126 -    }
  20.127 -    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
  20.128 -#ifdef DEBUG_AUDIO
  20.129 -    fprintf(stderr, "Creating UMS Audio device\n");
  20.130 -#endif
  20.131 -
  20.132 -    /*
  20.133 -     * Calls for UMS env initialization and audio object construction.
  20.134 -     */
  20.135 -    this->hidden->ev = somGetGlobalEnvironment();
  20.136 -    this->hidden->umsdev = UMSAudioDeviceNew();
  20.137 -
  20.138 -    /*
  20.139 -     * Set the function pointers.
  20.140 -     */
  20.141 -    this->OpenAudio = UMS_OpenAudio;
  20.142 -    this->WaitAudio = NULL;     /* we do blocking output */
  20.143 -    this->PlayAudio = UMS_PlayAudio;
  20.144 -    this->GetAudioBuf = UMS_GetAudioBuf;
  20.145 -    this->CloseAudio = UMS_CloseAudio;
  20.146 -    this->free = Audio_DeleteDevice;
  20.147 -
  20.148 -#ifdef DEBUG_AUDIO
  20.149 -    fprintf(stderr, "done\n");
  20.150 -#endif
  20.151 -    return this;
  20.152 -}
  20.153 -
  20.154 -AudioBootStrap UMS_bootstrap = {
  20.155 -    "ums", "AIX UMS audio", Audio_Available, Audio_CreateDevice, 0
  20.156 -};
  20.157 -
  20.158 -static Uint8 *
  20.159 -UMS_GetAudioBuf(_THIS)
  20.160 -{
  20.161 -#ifdef DEBUG_AUDIO
  20.162 -    fprintf(stderr, "enter UMS_GetAudioBuf\n");
  20.163 -#endif
  20.164 -    return this->hidden->fillbuf._buffer;
  20.165 -/*
  20.166 -    long                      bufSize;
  20.167 -    UMSAudioDevice_ReturnCode rc;
  20.168 -
  20.169 -    rc = UADSetTimeFormat(this, UMSAudioTypes_Bytes );
  20.170 -    rc = UADWriteBuffSize(this,  bufSize );
  20.171 -*/
  20.172 -}
  20.173 -
  20.174 -static void
  20.175 -UMS_CloseAudio(_THIS)
  20.176 -{
  20.177 -    UMSAudioDevice_ReturnCode rc;
  20.178 -
  20.179 -#ifdef DEBUG_AUDIO
  20.180 -    fprintf(stderr, "enter UMS_CloseAudio\n");
  20.181 -#endif
  20.182 -    rc = UADPlayRemainingData(this, TRUE);
  20.183 -    rc = UADStop(this);
  20.184 -    rc = UADClose(this);
  20.185 -}
  20.186 -
  20.187 -static void
  20.188 -UMS_PlayAudio(_THIS)
  20.189 -{
  20.190 -    UMSAudioDevice_ReturnCode rc;
  20.191 -    long samplesToWrite;
  20.192 -    long samplesWritten;
  20.193 -    UMSAudioTypes_Buffer swpbuf;
  20.194 -
  20.195 -#ifdef DEBUG_AUDIO
  20.196 -    fprintf(stderr, "enter UMS_PlayAudio\n");
  20.197 -#endif
  20.198 -    samplesToWrite =
  20.199 -        this->hidden->playbuf._length / this->hidden->bytesPerSample;
  20.200 -    do {
  20.201 -        rc = UADWrite(this, &this->hidden->playbuf,
  20.202 -                      samplesToWrite, &samplesWritten);
  20.203 -        samplesToWrite -= samplesWritten;
  20.204 -
  20.205 -        /* rc values: UMSAudioDevice_Success
  20.206 -         *            UMSAudioDevice_Failure
  20.207 -         *            UMSAudioDevice_Preempted
  20.208 -         *            UMSAudioDevice_Interrupted
  20.209 -         *            UMSAudioDevice_DeviceError
  20.210 -         */
  20.211 -        if (rc == UMSAudioDevice_DeviceError) {
  20.212 -#ifdef DEBUG_AUDIO
  20.213 -            fprintf(stderr, "Returning from PlayAudio with devices error\n");
  20.214 -#endif
  20.215 -            return;
  20.216 -        }
  20.217 -    } while (samplesToWrite > 0);
  20.218 -
  20.219 -    SDL_LockAudio();
  20.220 -    SDL_memcpy(&swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer));
  20.221 -    SDL_memcpy(&this->hidden->playbuf, &this->hidden->fillbuf,
  20.222 -               sizeof(UMSAudioTypes_Buffer));
  20.223 -    SDL_memcpy(&this->hidden->fillbuf, &swpbuf, sizeof(UMSAudioTypes_Buffer));
  20.224 -    SDL_UnlockAudio();
  20.225 -
  20.226 -#ifdef DEBUG_AUDIO
  20.227 -    fprintf(stderr, "Wrote audio data and swapped buffer\n");
  20.228 -#endif
  20.229 -}
  20.230 -
  20.231 -#if 0
  20.232 -//      /* Set the DSP frequency */
  20.233 -//      value = spec->freq;
  20.234 -//      if ( ioctl(this->hidden->audio_fd, SOUND_PCM_WRITE_RATE, &value) < 0 ) {
  20.235 -//              SDL_SetError("Couldn't set audio frequency");
  20.236 -//              return(-1);
  20.237 -//      }
  20.238 -//      spec->freq = value;
  20.239 -#endif
  20.240 -
  20.241 -static int
  20.242 -UMS_OpenAudio(_THIS, SDL_AudioSpec * spec)
  20.243 -{
  20.244 -    char *audiodev = "/dev/paud0";
  20.245 -    long lgain;
  20.246 -    long rgain;
  20.247 -    long outRate;
  20.248 -    long outBufSize;
  20.249 -    long bitsPerSample;
  20.250 -    long samplesPerSec;
  20.251 -    long success;
  20.252 -    SDL_AudioFormat test_format;
  20.253 -    int frag_spec;
  20.254 -    UMSAudioDevice_ReturnCode rc;
  20.255 -
  20.256 -#ifdef DEBUG_AUDIO
  20.257 -    fprintf(stderr, "enter UMS_OpenAudio\n");
  20.258 -#endif
  20.259 -    rc = UADOpen(this, audiodev, "PLAY", UMSAudioDevice_BlockingIO);
  20.260 -    if (rc != UMSAudioDevice_Success) {
  20.261 -        SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
  20.262 -        return -1;
  20.263 -    }
  20.264 -
  20.265 -    rc = UADSetAudioFormatType(this, "PCM");
  20.266 -
  20.267 -    success = 0;
  20.268 -    test_format = SDL_FirstAudioFormat(spec->format);
  20.269 -    do {
  20.270 -#ifdef DEBUG_AUDIO
  20.271 -        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
  20.272 -#endif
  20.273 -        switch (test_format) {
  20.274 -        case AUDIO_U8:
  20.275 -/* from the mac code: better ? */
  20.276 -/* sample_bits = spec->size / spec->samples / spec->channels * 8; */
  20.277 -            success = 1;
  20.278 -            bitsPerSample = 8;
  20.279 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.280 -            rc = UADSetByteOrder(this, "MSB");  /* irrelevant */
  20.281 -            rc = UADSetNumberFormat(this, "UNSIGNED");
  20.282 -            break;
  20.283 -        case AUDIO_S8:
  20.284 -            success = 1;
  20.285 -            bitsPerSample = 8;
  20.286 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.287 -            rc = UADSetByteOrder(this, "MSB");  /* irrelevant */
  20.288 -            rc = UADSetNumberFormat(this, "SIGNED");
  20.289 -            break;
  20.290 -        case AUDIO_S16LSB:
  20.291 -            success = 1;
  20.292 -            bitsPerSample = 16;
  20.293 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.294 -            rc = UADSetByteOrder(this, "LSB");
  20.295 -            rc = UADSetNumberFormat(this, "SIGNED");
  20.296 -            break;
  20.297 -        case AUDIO_S16MSB:
  20.298 -            success = 1;
  20.299 -            bitsPerSample = 16;
  20.300 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.301 -            rc = UADSetByteOrder(this, "MSB");
  20.302 -            rc = UADSetNumberFormat(this, "SIGNED");
  20.303 -            break;
  20.304 -        case AUDIO_U16LSB:
  20.305 -            success = 1;
  20.306 -            bitsPerSample = 16;
  20.307 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.308 -            rc = UADSetByteOrder(this, "LSB");
  20.309 -            rc = UADSetNumberFormat(this, "UNSIGNED");
  20.310 -            break;
  20.311 -        case AUDIO_U16MSB:
  20.312 -            success = 1;
  20.313 -            bitsPerSample = 16;
  20.314 -            rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
  20.315 -            rc = UADSetByteOrder(this, "MSB");
  20.316 -            rc = UADSetNumberFormat(this, "UNSIGNED");
  20.317 -            break;
  20.318 -        default:
  20.319 -            break;
  20.320 -        }
  20.321 -        if (!success) {
  20.322 -            test_format = SDL_NextAudioFormat();
  20.323 -        }
  20.324 -    } while (!success && test_format);
  20.325 -
  20.326 -    if (success == 0) {
  20.327 -        SDL_SetError("Couldn't find any hardware audio formats");
  20.328 -        return -1;
  20.329 -    }
  20.330 -
  20.331 -    spec->format = test_format;
  20.332 -
  20.333 -    for (frag_spec = 0; (0x01 << frag_spec) < spec->size; ++frag_spec);
  20.334 -    if ((0x01 << frag_spec) != spec->size) {
  20.335 -        SDL_SetError("Fragment size must be a power of two");
  20.336 -        return -1;
  20.337 -    }
  20.338 -    if (frag_spec > 2048)
  20.339 -        frag_spec = 2048;
  20.340 -
  20.341 -    this->hidden->bytesPerSample = (bitsPerSample / 8) * spec->channels;
  20.342 -    samplesPerSec = this->hidden->bytesPerSample * outRate;
  20.343 -
  20.344 -    this->hidden->playbuf._length = 0;
  20.345 -    this->hidden->playbuf._maximum = spec->size;
  20.346 -    this->hidden->playbuf._buffer = (unsigned char *) SDL_malloc(spec->size);
  20.347 -    this->hidden->fillbuf._length = 0;
  20.348 -    this->hidden->fillbuf._maximum = spec->size;
  20.349 -    this->hidden->fillbuf._buffer = (unsigned char *) SDL_malloc(spec->size);
  20.350 -
  20.351 -    rc = UADSetBitsPerSample(this, bitsPerSample);
  20.352 -    rc = UADSetDMABufferSize(this, frag_spec, &outBufSize);
  20.353 -    rc = UADSetChannels(this, spec->channels);  /* functions reduces to mono or stereo */
  20.354 -
  20.355 -    lgain = 100;                /*maximum left input gain */
  20.356 -    rgain = 100;                /*maimum right input gain */
  20.357 -    rc = UADEnableOutput(this, "LINE_OUT", &lgain, &rgain);
  20.358 -    rc = UADInitialize(this);
  20.359 -    rc = UADStart(this);
  20.360 -    rc = UADSetVolume(this, 100);
  20.361 -    rc = UADSetBalance(this, 0);
  20.362 -
  20.363 -    /* We're ready to rock and roll. :-) */
  20.364 -    return 0;
  20.365 -}
  20.366 -
  20.367 -
  20.368 -static UMSAudioDevice_ReturnCode
  20.369 -UADGetBitsPerSample(_THIS, long *bits)
  20.370 -{
  20.371 -    return UMSAudioDevice_get_bits_per_sample(this->hidden->umsdev,
  20.372 -                                              this->hidden->ev, bits);
  20.373 -}
  20.374 -
  20.375 -static UMSAudioDevice_ReturnCode
  20.376 -UADSetBitsPerSample(_THIS, long bits)
  20.377 -{
  20.378 -    return UMSAudioDevice_set_bits_per_sample(this->hidden->umsdev,
  20.379 -                                              this->hidden->ev, bits);
  20.380 -}
  20.381 -
  20.382 -static UMSAudioDevice_ReturnCode
  20.383 -UADSetSampleRate(_THIS, long rate, long *set_rate)
  20.384 -{
  20.385 -    /* from the mac code: sample rate = spec->freq << 16; */
  20.386 -    return UMSAudioDevice_set_sample_rate(this->hidden->umsdev,
  20.387 -                                          this->hidden->ev, rate, set_rate);
  20.388 -}
  20.389 -
  20.390 -static UMSAudioDevice_ReturnCode
  20.391 -UADSetByteOrder(_THIS, string byte_order)
  20.392 -{
  20.393 -    return UMSAudioDevice_set_byte_order(this->hidden->umsdev,
  20.394 -                                         this->hidden->ev, byte_order);
  20.395 -}
  20.396 -
  20.397 -static UMSAudioDevice_ReturnCode
  20.398 -UADSetAudioFormatType(_THIS, string fmt)
  20.399 -{
  20.400 -    /* possible PCM, A_LAW or MU_LAW */
  20.401 -    return UMSAudioDevice_set_audio_format_type(this->hidden->umsdev,
  20.402 -                                                this->hidden->ev, fmt);
  20.403 -}
  20.404 -
  20.405 -static UMSAudioDevice_ReturnCode
  20.406 -UADSetNumberFormat(_THIS, string fmt)
  20.407 -{
  20.408 -    /* possible SIGNED, UNSIGNED, or TWOS_COMPLEMENT */
  20.409 -    return UMSAudioDevice_set_number_format(this->hidden->umsdev,
  20.410 -                                            this->hidden->ev, fmt);
  20.411 -}
  20.412 -
  20.413 -static UMSAudioDevice_ReturnCode
  20.414 -UADInitialize(_THIS)
  20.415 -{
  20.416 -    return UMSAudioDevice_initialize(this->hidden->umsdev, this->hidden->ev);
  20.417 -}
  20.418 -
  20.419 -static UMSAudioDevice_ReturnCode
  20.420 -UADStart(_THIS)
  20.421 -{
  20.422 -    return UMSAudioDevice_start(this->hidden->umsdev, this->hidden->ev);
  20.423 -}
  20.424 -
  20.425 -static UMSAudioDevice_ReturnCode
  20.426 -UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt)
  20.427 -{
  20.428 -    /*
  20.429 -     * Switches the time format to the new format, immediately.
  20.430 -     * possible UMSAudioTypes_Msecs, UMSAudioTypes_Bytes or UMSAudioTypes_Samples
  20.431 -     */
  20.432 -    return UMSAudioDevice_set_time_format(this->hidden->umsdev,
  20.433 -                                          this->hidden->ev, fmt);
  20.434 -}
  20.435 -
  20.436 -static UMSAudioDevice_ReturnCode
  20.437 -UADWriteBuffSize(_THIS, long *buff_size)
  20.438 -{
  20.439 -    /*
  20.440 -     * returns write buffer size in the current time format
  20.441 -     */
  20.442 -    return UMSAudioDevice_write_buff_size(this->hidden->umsdev,
  20.443 -                                          this->hidden->ev, buff_size);
  20.444 -}
  20.445 -
  20.446 -static UMSAudioDevice_ReturnCode
  20.447 -UADWriteBuffRemain(_THIS, long *buff_size)
  20.448 -{
  20.449 -    /*
  20.450 -     * returns amount of available space in the write buffer
  20.451 -     * in the current time format
  20.452 -     */
  20.453 -    return UMSAudioDevice_write_buff_remain(this->hidden->umsdev,
  20.454 -                                            this->hidden->ev, buff_size);
  20.455 -}
  20.456 -
  20.457 -static UMSAudioDevice_ReturnCode
  20.458 -UADWriteBuffUsed(_THIS, long *buff_size)
  20.459 -{
  20.460 -    /*
  20.461 -     * returns amount of filled space in the write buffer
  20.462 -     * in the current time format
  20.463 -     */
  20.464 -    return UMSAudioDevice_write_buff_used(this->hidden->umsdev,
  20.465 -                                          this->hidden->ev, buff_size);
  20.466 -}
  20.467 -
  20.468 -static UMSAudioDevice_ReturnCode
  20.469 -UADSetDMABufferSize(_THIS, long bytes, long *bytes_ret)
  20.470 -{
  20.471 -    /*
  20.472 -     * Request a new DMA buffer size, maximum requested size 2048.
  20.473 -     * Takes effect with next initialize() call.
  20.474 -     * Devices may or may not support DMA.
  20.475 -     */
  20.476 -    return UMSAudioDevice_set_DMA_buffer_size(this->hidden->umsdev,
  20.477 -                                              this->hidden->ev,
  20.478 -                                              bytes, bytes_ret);
  20.479 -}
  20.480 -
  20.481 -static UMSAudioDevice_ReturnCode
  20.482 -UADSetVolume(_THIS, long volume)
  20.483 -{
  20.484 -    /*
  20.485 -     * Set the volume.
  20.486 -     * Takes effect immediately.
  20.487 -     */
  20.488 -    return UMSAudioDevice_set_volume(this->hidden->umsdev,
  20.489 -                                     this->hidden->ev, volume);
  20.490 -}
  20.491 -
  20.492 -static UMSAudioDevice_ReturnCode
  20.493 -UADSetBalance(_THIS, long balance)
  20.494 -{
  20.495 -    /*
  20.496 -     * Set the balance.
  20.497 -     * Takes effect immediately.
  20.498 -     */
  20.499 -    return UMSAudioDevice_set_balance(this->hidden->umsdev,
  20.500 -                                      this->hidden->ev, balance);
  20.501 -}
  20.502 -
  20.503 -static UMSAudioDevice_ReturnCode
  20.504 -UADSetChannels(_THIS, long channels)
  20.505 -{
  20.506 -    /*
  20.507 -     * Set mono or stereo.
  20.508 -     * Takes effect with next initialize() call.
  20.509 -     */
  20.510 -    if (channels != 1)
  20.511 -        channels = 2;
  20.512 -    return UMSAudioDevice_set_number_of_channels(this->hidden->umsdev,
  20.513 -                                                 this->hidden->ev, channels);
  20.514 -}
  20.515 -
  20.516 -static UMSAudioDevice_ReturnCode
  20.517 -UADOpen(_THIS, string device, string mode, long flags)
  20.518 -{
  20.519 -    return UMSAudioDevice_open(this->hidden->umsdev,
  20.520 -                               this->hidden->ev, device, mode, flags);
  20.521 -}
  20.522 -
  20.523 -static UMSAudioDevice_ReturnCode
  20.524 -UADWrite(_THIS, UMSAudioTypes_Buffer * buff,
  20.525 -         long samples, long *samples_written)
  20.526 -{
  20.527 -    return UMSAudioDevice_write(this->hidden->umsdev,
  20.528 -                                this->hidden->ev,
  20.529 -                                buff, samples, samples_written);
  20.530 -}
  20.531 -
  20.532 -static UMSAudioDevice_ReturnCode
  20.533 -UADPlayRemainingData(_THIS, boolean block)
  20.534 -{
  20.535 -    return UMSAudioDevice_play_remaining_data(this->hidden->umsdev,
  20.536 -                                              this->hidden->ev, block);
  20.537 -}
  20.538 -
  20.539 -static UMSAudioDevice_ReturnCode
  20.540 -UADStop(_THIS)
  20.541 -{
  20.542 -    return UMSAudioDevice_stop(this->hidden->umsdev, this->hidden->ev);
  20.543 -}
  20.544 -
  20.545 -static UMSAudioDevice_ReturnCode
  20.546 -UADClose(_THIS)
  20.547 -{
  20.548 -    return UMSAudioDevice_close(this->hidden->umsdev, this->hidden->ev);
  20.549 -}
  20.550 -
  20.551 -static UMSAudioDevice_ReturnCode
  20.552 -UADEnableOutput(_THIS, string output, long *left_gain, long *right_gain)
  20.553 -{
  20.554 -    return UMSAudioDevice_enable_output(this->hidden->umsdev,
  20.555 -                                        this->hidden->ev,
  20.556 -                                        output, left_gain, right_gain);
  20.557 -}
  20.558 -
  20.559 -/* vi: set ts=4 sw=4 expandtab: */
    21.1 --- a/src/audio/ums/SDL_umsaudio.h	Mon Oct 31 03:06:32 2011 -0400
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,47 +0,0 @@
    21.4 -/*
    21.5 -  Simple DirectMedia Layer
    21.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    21.7 -
    21.8 -  This software is provided 'as-is', without any express or implied
    21.9 -  warranty.  In no event will the authors be held liable for any damages
   21.10 -  arising from the use of this software.
   21.11 -
   21.12 -  Permission is granted to anyone to use this software for any purpose,
   21.13 -  including commercial applications, and to alter it and redistribute it
   21.14 -  freely, subject to the following restrictions:
   21.15 -
   21.16 -  1. The origin of this software must not be misrepresented; you must not
   21.17 -     claim that you wrote the original software. If you use this software
   21.18 -     in a product, an acknowledgment in the product documentation would be
   21.19 -     appreciated but is not required.
   21.20 -  2. Altered source versions must be plainly marked as such, and must not be
   21.21 -     misrepresented as being the original software.
   21.22 -  3. This notice may not be removed or altered from any source distribution.
   21.23 -*/
   21.24 -#include "SDL_config.h"
   21.25 -
   21.26 -#ifndef _SDL_UMSaudio_h
   21.27 -#define _SDL_UMSaudio_h
   21.28 -
   21.29 -#include <UMS/UMSAudioDevice.h>
   21.30 -
   21.31 -#include "../SDL_sysaudio.h"
   21.32 -
   21.33 -/* Hidden "this" pointer for the audio functions */
   21.34 -#define _THIS	SDL_AudioDevice *this
   21.35 -
   21.36 -struct SDL_PrivateAudioData
   21.37 -{
   21.38 -    /* Pointer to the (open) UMS audio device */
   21.39 -    Environment *ev;
   21.40 -    UMSAudioDevice umsdev;
   21.41 -
   21.42 -    /* Raw mixing buffer */
   21.43 -    UMSAudioTypes_Buffer playbuf;
   21.44 -    UMSAudioTypes_Buffer fillbuf;
   21.45 -
   21.46 -    long bytesPerSample;
   21.47 -};
   21.48 -
   21.49 -#endif /* _SDL_UMSaudio_h */
   21.50 -/* vi: set ts=4 sw=4 expandtab: */
    22.1 --- a/src/audio/winmm/SDL_winmm.c	Mon Oct 31 03:06:32 2011 -0400
    22.2 +++ b/src/audio/winmm/SDL_winmm.c	Mon Oct 31 05:56:58 2011 -0400
    22.3 @@ -20,6 +20,8 @@
    22.4  */
    22.5  #include "SDL_config.h"
    22.6  
    22.7 +#if SDL_AUDIO_DRIVER_WINMM
    22.8 +
    22.9  /* Allow access to a raw mixing buffer */
   22.10  
   22.11  #include "../../core/windows/SDL_windows.h"
   22.12 @@ -406,4 +408,6 @@
   22.13      "winmm", "Windows Waveform Audio", WINMM_Init, 0
   22.14  };
   22.15  
   22.16 +#endif /* SDL_AUDIO_DRIVER_WINMM */
   22.17 +
   22.18  /* vi: set ts=4 sw=4 expandtab: */
    23.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Mon Oct 31 03:06:32 2011 -0400
    23.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Mon Oct 31 05:56:58 2011 -0400
    23.3 @@ -19,14 +19,15 @@
    23.4    3. This notice may not be removed or altered from any source distribution.
    23.5  */
    23.6  #include "SDL_config.h"
    23.7 +
    23.8 +#if SDL_AUDIO_DRIVER_XAUDIO2
    23.9 +
   23.10  #include "../../core/windows/SDL_windows.h"
   23.11  #include "SDL_audio.h"
   23.12  #include "../SDL_audio_c.h"
   23.13  #include "../SDL_sysaudio.h"
   23.14  #include "SDL_assert.h"
   23.15  
   23.16 -#if SDL_AUDIO_DRIVER_XAUDIO2
   23.17 -
   23.18  #include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
   23.19  #if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
   23.20  #  warning Your DirectX SDK is too old. Disabling XAudio2 support.
    24.1 --- a/src/core/android/SDL_android.cpp	Mon Oct 31 03:06:32 2011 -0400
    24.2 +++ b/src/core/android/SDL_android.cpp	Mon Oct 31 05:56:58 2011 -0400
    24.3 @@ -21,6 +21,8 @@
    24.4  #include "SDL_config.h"
    24.5  #include "SDL_stdinc.h"
    24.6  
    24.7 +#ifdef __ANDROID__
    24.8 +
    24.9  #include "SDL_android.h"
   24.10  
   24.11  extern "C" {
   24.12 @@ -605,4 +607,6 @@
   24.13      return Android_JNI_FileClose(ctx, true);
   24.14  }
   24.15  
   24.16 +#endif /* __ANDROID__ */
   24.17 +
   24.18  /* vi: set ts=4 sw=4 expandtab: */
    25.1 --- a/src/core/windows/SDL_windows.c	Mon Oct 31 03:06:32 2011 -0400
    25.2 +++ b/src/core/windows/SDL_windows.c	Mon Oct 31 05:56:58 2011 -0400
    25.3 @@ -20,6 +20,8 @@
    25.4  */
    25.5  #include "SDL_config.h"
    25.6  
    25.7 +#ifdef __WIN32__
    25.8 +
    25.9  #include "SDL_error.h"
   25.10  #include "SDL_windows.h"
   25.11  
   25.12 @@ -59,4 +61,6 @@
   25.13      CoUninitialize();
   25.14  }
   25.15  
   25.16 +#endif /* __WIN32__ */
   25.17 +
   25.18  /* vi: set ts=4 sw=4 expandtab: */
    26.1 --- a/src/events/SDL_gesture.c	Mon Oct 31 03:06:32 2011 -0400
    26.2 +++ b/src/events/SDL_gesture.c	Mon Oct 31 05:56:58 2011 -0400
    26.3 @@ -103,7 +103,7 @@
    26.4    return (touchId < 0);
    26.5  }
    26.6  
    26.7 -unsigned long SDL_HashDollar(SDL_FloatPoint* points) {
    26.8 +static unsigned long SDL_HashDollar(SDL_FloatPoint* points) {
    26.9    unsigned long hash = 5381;
   26.10    int i;
   26.11    for(i = 0;i < DOLLARNPOINTS; i++) { 
   26.12 @@ -242,7 +242,7 @@
   26.13  }
   26.14  
   26.15  
   26.16 -float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
   26.17 +static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
   26.18    //  SDL_FloatPoint p[DOLLARNPOINTS];
   26.19    float dist = 0;
   26.20    SDL_FloatPoint p;
   26.21 @@ -257,7 +257,7 @@
   26.22    
   26.23  }
   26.24  
   26.25 -float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
   26.26 +static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
   26.27    //------------BEGIN DOLLAR BLACKBOX----------------//
   26.28    //-TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT-//
   26.29    //-"http://depts.washington.edu/aimgroup/proj/dollar/"-//
   26.30 @@ -294,7 +294,7 @@
   26.31  }
   26.32  
   26.33  //DollarPath contains raw points, plus (possibly) the calculated length
   26.34 -int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
   26.35 +static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
   26.36    int i;
   26.37    float interval;
   26.38    float dist;
   26.39 @@ -387,7 +387,7 @@
   26.40    return numPoints;
   26.41  }
   26.42  
   26.43 -float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) {
   26.44 +static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) {
   26.45          
   26.46          SDL_FloatPoint points[DOLLARNPOINTS];
   26.47          int i;
   26.48 @@ -431,20 +431,7 @@
   26.49    return 0;
   26.50  }
   26.51  
   26.52 -int SDL_GestureRemoveTouch(SDL_TouchID id) {
   26.53 -  int i;
   26.54 -  for (i = 0; i < SDL_numGestureTouches; i++) {
   26.55 -    if (SDL_gestureTouch[i].id == id) {
   26.56 -      SDL_numGestureTouches--;
   26.57 -      SDL_memcpy(&SDL_gestureTouch[i], &SDL_gestureTouch[SDL_numGestureTouches], sizeof(SDL_gestureTouch[i]));
   26.58 -      return 1;
   26.59 -    }
   26.60 -  }
   26.61 -  return -1;
   26.62 -}
   26.63 -
   26.64 -
   26.65 -SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
   26.66 +static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
   26.67    int i;
   26.68    for(i = 0;i < SDL_numGestureTouches; i++) {
   26.69      //printf("%i ?= %i\n",SDL_gestureTouch[i].id,id);
   26.70 @@ -453,7 +440,7 @@
   26.71    return NULL;
   26.72  }
   26.73  
   26.74 -int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
   26.75 +static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
   26.76    SDL_Event event;
   26.77    event.mgesture.type = SDL_MULTIGESTURE;
   26.78    event.mgesture.touchId = touch->id;
   26.79 @@ -465,7 +452,7 @@
   26.80    return SDL_PushEvent(&event) > 0;
   26.81  }
   26.82  
   26.83 -int SDL_SendGestureDollar(SDL_GestureTouch* touch,
   26.84 +static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
   26.85                            SDL_GestureID gestureId,float error) {
   26.86    SDL_Event event;
   26.87    event.dgesture.type = SDL_DOLLARGESTURE;
   26.88 @@ -483,7 +470,7 @@
   26.89  }
   26.90  
   26.91  
   26.92 -int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) {
   26.93 +static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) {
   26.94    SDL_Event event;
   26.95    event.dgesture.type = SDL_DOLLARRECORD;
   26.96    event.dgesture.touchId = touch->id;
    27.1 --- a/src/events/SDL_keyboard.c	Mon Oct 31 03:06:32 2011 -0400
    27.2 +++ b/src/events/SDL_keyboard.c	Mon Oct 31 05:56:58 2011 -0400
    27.3 @@ -854,23 +854,6 @@
    27.4      return keyboard->keymap[scancode];
    27.5  }
    27.6  
    27.7 -SDL_Keycode SDL_GetKeycodeFromName(const char *name)
    27.8 -{
    27.9 -	int i;
   27.10 -
   27.11 -	if (!name || !*name) {
   27.12 -		return SDL_SCANCODE_UNKNOWN;
   27.13 -	}
   27.14 -
   27.15 -	for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) {
   27.16 -		if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) {
   27.17 -			return (SDL_Scancode)i;
   27.18 -		}
   27.19 -	}
   27.20 -	return SDL_SCANCODE_UNKNOWN;
   27.21 -}
   27.22 -
   27.23 -
   27.24  SDL_Scancode
   27.25  SDL_GetScancodeFromKey(SDL_Keycode key)
   27.26  {
    28.1 --- a/src/events/SDL_touch.c	Mon Oct 31 03:06:32 2011 -0400
    28.2 +++ b/src/events/SDL_touch.c	Mon Oct 31 05:56:58 2011 -0400
    28.3 @@ -59,7 +59,7 @@
    28.4      return SDL_touchPads[index];
    28.5  }
    28.6  
    28.7 -int
    28.8 +static int
    28.9  SDL_GetFingerIndexId(SDL_Touch* touch,SDL_FingerID fingerid)
   28.10  {
   28.11      int i;
   28.12 @@ -190,6 +190,7 @@
   28.13  {
   28.14      return SDL_num_touch;
   28.15  }
   28.16 +
   28.17  SDL_Window *
   28.18  SDL_GetTouchFocusWindow(SDL_TouchID id)
   28.19  {
    29.1 --- a/src/libm/e_atan2.c	Mon Oct 31 03:06:32 2011 -0400
    29.2 +++ b/src/libm/e_atan2.c	Mon Oct 31 05:56:58 2011 -0400
    29.3 @@ -36,7 +36,7 @@
    29.4   * to produce the hexadecimal values shown.
    29.5   */
    29.6  
    29.7 -#include "math.h"
    29.8 +#include "math_libm.h"
    29.9  #include "math_private.h"
   29.10  
   29.11  static const double
    30.1 --- a/src/libm/e_log.c	Mon Oct 31 03:06:32 2011 -0400
    30.2 +++ b/src/libm/e_log.c	Mon Oct 31 05:56:58 2011 -0400
    30.3 @@ -66,7 +66,7 @@
    30.4   * to produce the hexadecimal values shown.
    30.5   */
    30.6  
    30.7 -#include "math.h"
    30.8 +#include "math_libm.h"
    30.9  #include "math_private.h"
   30.10  
   30.11  #ifdef __STDC__
    31.1 --- a/src/libm/e_pow.c	Mon Oct 31 03:06:32 2011 -0400
    31.2 +++ b/src/libm/e_pow.c	Mon Oct 31 05:56:58 2011 -0400
    31.3 @@ -59,7 +59,7 @@
    31.4   * to produce the hexadecimal values shown.
    31.5   */
    31.6  
    31.7 -#include "math.h"
    31.8 +#include "math_libm.h"
    31.9  #include "math_private.h"
   31.10  
   31.11  libm_hidden_proto(scalbn)
    32.1 --- a/src/libm/e_rem_pio2.c	Mon Oct 31 03:06:32 2011 -0400
    32.2 +++ b/src/libm/e_rem_pio2.c	Mon Oct 31 05:56:58 2011 -0400
    32.3 @@ -21,7 +21,7 @@
    32.4   * use __kernel_rem_pio2()
    32.5   */
    32.6  
    32.7 -#include "math.h"
    32.8 +#include "math_libm.h"
    32.9  #include "math_private.h"
   32.10  
   32.11  libm_hidden_proto(fabs)
    33.1 --- a/src/libm/e_sqrt.c	Mon Oct 31 03:06:32 2011 -0400
    33.2 +++ b/src/libm/e_sqrt.c	Mon Oct 31 05:56:58 2011 -0400
    33.3 @@ -85,7 +85,7 @@
    33.4   *---------------
    33.5   */
    33.6  
    33.7 -#include "math.h"
    33.8 +#include "math_libm.h"
    33.9  #include "math_private.h"
   33.10  
   33.11  #ifdef __STDC__
    34.1 --- a/src/libm/k_cos.c	Mon Oct 31 03:06:32 2011 -0400
    34.2 +++ b/src/libm/k_cos.c	Mon Oct 31 05:56:58 2011 -0400
    34.3 @@ -50,7 +50,7 @@
    34.4   *	   thus, reducing the rounding error in the subtraction.
    34.5   */
    34.6  
    34.7 -#include "math.h"
    34.8 +#include "math_libm.h"
    34.9  #include "math_private.h"
   34.10  
   34.11  #ifdef __STDC__
    35.1 --- a/src/libm/k_rem_pio2.c	Mon Oct 31 03:06:32 2011 -0400
    35.2 +++ b/src/libm/k_rem_pio2.c	Mon Oct 31 05:56:58 2011 -0400
    35.3 @@ -131,7 +131,7 @@
    35.4   * to produce the hexadecimal values shown.
    35.5   */
    35.6  
    35.7 -#include "math.h"
    35.8 +#include "math_libm.h"
    35.9  #include "math_private.h"
   35.10  
   35.11  libm_hidden_proto(scalbn)
    36.1 --- a/src/libm/k_sin.c	Mon Oct 31 03:06:32 2011 -0400
    36.2 +++ b/src/libm/k_sin.c	Mon Oct 31 05:56:58 2011 -0400
    36.3 @@ -43,7 +43,7 @@
    36.4   *		sin(x) = x + (S1*x + (x *(r-y/2)+y))
    36.5   */
    36.6  
    36.7 -#include "math.h"
    36.8 +#include "math_libm.h"
    36.9  #include "math_private.h"
   36.10  
   36.11  #ifdef __STDC__
    37.1 --- a/src/libm/math.h	Mon Oct 31 03:06:32 2011 -0400
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,84 +0,0 @@
    37.4 -/*
    37.5 -  Simple DirectMedia Layer
    37.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    37.7 -
    37.8 -  This software is provided 'as-is', without any express or implied
    37.9 -  warranty.  In no event will the authors be held liable for any damages
   37.10 -  arising from the use of this software.
   37.11 -
   37.12 -  Permission is granted to anyone to use this software for any purpose,
   37.13 -  including commercial applications, and to alter it and redistribute it
   37.14 -  freely, subject to the following restrictions:
   37.15 -
   37.16 -  1. The origin of this software must not be misrepresented; you must not
   37.17 -     claim that you wrote the original software. If you use this software
   37.18 -     in a product, an acknowledgment in the product documentation would be
   37.19 -     appreciated but is not required.
   37.20 -  2. Altered source versions must be plainly marked as such, and must not be
   37.21 -     misrepresented as being the original software.
   37.22 -  3. This notice may not be removed or altered from any source distribution.
   37.23 -*/
   37.24 -#include "SDL_config.h"
   37.25 -#include "SDL_stdinc.h"
   37.26 -
   37.27 -/* Math routines from uClibc: http://www.uclibc.org */
   37.28 -
   37.29 -#ifdef HAVE_ATAN
   37.30 -#define atan            SDL_uclibc_atan
   37.31 -#else
   37.32 -#define atan            SDL_atan
   37.33 -#endif
   37.34 -
   37.35 -#ifndef HAVE_ATAN2
   37.36 -#define __ieee754_atan2 SDL_atan2
   37.37 -#endif
   37.38 -
   37.39 -#ifdef HAVE_COPYSIGN
   37.40 -#define copysign        SDL_uclibc_copysign
   37.41 -#else
   37.42 -#define copysign        SDL_copysign
   37.43 -#endif
   37.44 -
   37.45 -#ifdef HAVE_COS
   37.46 -#define cos             SDL_uclibc_cos
   37.47 -#else
   37.48 -#define cos             SDL_cos
   37.49 -#endif
   37.50 -
   37.51 -#ifdef HAVE_FABS
   37.52 -#define fabs            SDL_uclibc_fabs
   37.53 -#else
   37.54 -#define fabs            SDL_fabs
   37.55 -#endif
   37.56 -
   37.57 -#ifdef HAVE_FLOOR
   37.58 -#define floor           SDL_uclibc_floor
   37.59 -#else
   37.60 -#define floor           SDL_floor
   37.61 -#endif
   37.62 -
   37.63 -#ifndef HAVE_LOG
   37.64 -#define __ieee754_log   SDL_log
   37.65 -#endif
   37.66 -
   37.67 -#ifndef HAVE_POW
   37.68 -#define __ieee754_pow   SDL_pow
   37.69 -#endif
   37.70 -
   37.71 -#ifdef HAVE_SCALBN
   37.72 -#define scalbn          SDL_uclibc_scalbn
   37.73 -#else
   37.74 -#define scalbn          SDL_scalbn
   37.75 -#endif
   37.76 -
   37.77 -#ifdef HAVE_SIN
   37.78 -#define sin             SDL_uclibc_sin
   37.79 -#else
   37.80 -#define sin             SDL_sin
   37.81 -#endif
   37.82 -
   37.83 -#ifndef HAVE_SQRT
   37.84 -#define __ieee754_sqrt  SDL_sqrt
   37.85 -#endif
   37.86 -
   37.87 -/* vi: set ts=4 sw=4 expandtab: */
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/src/libm/math_libm.h	Mon Oct 31 05:56:58 2011 -0400
    38.3 @@ -0,0 +1,91 @@
    38.4 +/*
    38.5 +  Simple DirectMedia Layer
    38.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    38.7 +
    38.8 +  This software is provided 'as-is', without any express or implied
    38.9 +  warranty.  In no event will the authors be held liable for any damages
   38.10 +  arising from the use of this software.
   38.11 +
   38.12 +  Permission is granted to anyone to use this software for any purpose,
   38.13 +  including commercial applications, and to alter it and redistribute it
   38.14 +  freely, subject to the following restrictions:
   38.15 +
   38.16 +  1. The origin of this software must not be misrepresented; you must not
   38.17 +     claim that you wrote the original software. If you use this software
   38.18 +     in a product, an acknowledgment in the product documentation would be
   38.19 +     appreciated but is not required.
   38.20 +  2. Altered source versions must be plainly marked as such, and must not be
   38.21 +     misrepresented as being the original software.
   38.22 +  3. This notice may not be removed or altered from any source distribution.
   38.23 +*/
   38.24 +#include "SDL_config.h"
   38.25 +#include "SDL_stdinc.h"
   38.26 +
   38.27 +/* Math routines from uClibc: http://www.uclibc.org */
   38.28 +
   38.29 +#ifdef HAVE_ATAN
   38.30 +#define atan            SDL_uclibc_atan
   38.31 +#else
   38.32 +#define atan            SDL_atan
   38.33 +#endif
   38.34 +double atan(double x);
   38.35 +
   38.36 +#ifndef HAVE_ATAN2
   38.37 +#define __ieee754_atan2 SDL_atan2
   38.38 +#endif
   38.39 +
   38.40 +#ifdef HAVE_COPYSIGN
   38.41 +#define copysign        SDL_uclibc_copysign
   38.42 +#else
   38.43 +#define copysign        SDL_copysign
   38.44 +#endif
   38.45 +double copysign(double x, double y);
   38.46 +
   38.47 +#ifdef HAVE_COS
   38.48 +#define cos             SDL_uclibc_cos
   38.49 +#else
   38.50 +#define cos             SDL_cos
   38.51 +#endif
   38.52 +double cos(double x);
   38.53 +
   38.54 +#ifdef HAVE_FABS
   38.55 +#define fabs            SDL_uclibc_fabs
   38.56 +#else
   38.57 +#define fabs            SDL_fabs
   38.58 +#endif
   38.59 +double fabs(double x);
   38.60 +
   38.61 +#ifdef HAVE_FLOOR
   38.62 +#define floor           SDL_uclibc_floor
   38.63 +#else
   38.64 +#define floor           SDL_floor
   38.65 +#endif
   38.66 +double floor(double x);
   38.67 +
   38.68 +#ifndef HAVE_LOG
   38.69 +#define __ieee754_log   SDL_log
   38.70 +#endif
   38.71 +
   38.72 +#ifndef HAVE_POW
   38.73 +#define __ieee754_pow   SDL_pow
   38.74 +#endif
   38.75 +
   38.76 +#ifdef HAVE_SCALBN
   38.77 +#define scalbn          SDL_uclibc_scalbn
   38.78 +#else
   38.79 +#define scalbn          SDL_scalbn
   38.80 +#endif
   38.81 +double scalbn(double x, int n);
   38.82 +
   38.83 +#ifdef HAVE_SIN
   38.84 +#define sin             SDL_uclibc_sin
   38.85 +#else
   38.86 +#define sin             SDL_sin
   38.87 +#endif
   38.88 +double sin(double x);
   38.89 +
   38.90 +#ifndef HAVE_SQRT
   38.91 +#define __ieee754_sqrt  SDL_sqrt
   38.92 +#endif
   38.93 +
   38.94 +/* vi: set ts=4 sw=4 expandtab: */
    39.1 --- a/src/libm/s_atan.c	Mon Oct 31 03:06:32 2011 -0400
    39.2 +++ b/src/libm/s_atan.c	Mon Oct 31 05:56:58 2011 -0400
    39.3 @@ -29,7 +29,7 @@
    39.4   * to produce the hexadecimal values shown.
    39.5   */
    39.6  
    39.7 -#include "math.h"
    39.8 +#include "math_libm.h"
    39.9  #include "math_private.h"
   39.10  
   39.11  static const double atanhi[] = {
    40.1 --- a/src/libm/s_copysign.c	Mon Oct 31 03:06:32 2011 -0400
    40.2 +++ b/src/libm/s_copysign.c	Mon Oct 31 05:56:58 2011 -0400
    40.3 @@ -21,7 +21,7 @@
    40.4   * with the sign bit of y.
    40.5   */
    40.6  
    40.7 -#include "math.h"
    40.8 +#include "math_libm.h"
    40.9  #include "math_private.h"
   40.10  
   40.11  libm_hidden_proto(copysign)
    41.1 --- a/src/libm/s_cos.c	Mon Oct 31 03:06:32 2011 -0400
    41.2 +++ b/src/libm/s_cos.c	Mon Oct 31 05:56:58 2011 -0400
    41.3 @@ -46,7 +46,7 @@
    41.4   *	TRIG(x) returns trig(x) nearly rounded
    41.5   */
    41.6  
    41.7 -#include "math.h"
    41.8 +#include "math_libm.h"
    41.9  #include "math_private.h"
   41.10  
   41.11  libm_hidden_proto(cos)
    42.1 --- a/src/libm/s_fabs.c	Mon Oct 31 03:06:32 2011 -0400
    42.2 +++ b/src/libm/s_fabs.c	Mon Oct 31 05:56:58 2011 -0400
    42.3 @@ -19,7 +19,7 @@
    42.4   * fabs(x) returns the absolute value of x.
    42.5   */
    42.6  
    42.7 -#include "math.h"
    42.8 +#include "math_libm.h"
    42.9  #include "math_private.h"
   42.10  
   42.11  libm_hidden_proto(fabs)
    43.1 --- a/src/libm/s_floor.c	Mon Oct 31 03:06:32 2011 -0400
    43.2 +++ b/src/libm/s_floor.c	Mon Oct 31 05:56:58 2011 -0400
    43.3 @@ -24,7 +24,7 @@
    43.4   *	Inexact flag raised if x not equal to floor(x).
    43.5   */
    43.6  
    43.7 -#include "math.h"
    43.8 +#include "math_libm.h"
    43.9  #include "math_private.h"
   43.10  
   43.11  #ifdef __STDC__
    44.1 --- a/src/libm/s_scalbn.c	Mon Oct 31 03:06:32 2011 -0400
    44.2 +++ b/src/libm/s_scalbn.c	Mon Oct 31 05:56:58 2011 -0400
    44.3 @@ -22,7 +22,7 @@
    44.4   * exponentiation or a multiplication.
    44.5   */
    44.6  
    44.7 -#include "math.h"
    44.8 +#include "math_libm.h"
    44.9  #include "math_private.h"
   44.10  
   44.11  libm_hidden_proto(copysign)
    45.1 --- a/src/libm/s_sin.c	Mon Oct 31 03:06:32 2011 -0400
    45.2 +++ b/src/libm/s_sin.c	Mon Oct 31 05:56:58 2011 -0400
    45.3 @@ -46,7 +46,7 @@
    45.4   *	TRIG(x) returns trig(x) nearly rounded
    45.5   */
    45.6  
    45.7 -#include "math.h"
    45.8 +#include "math_libm.h"
    45.9  #include "math_private.h"
   45.10  
   45.11  libm_hidden_proto(sin)
    46.1 --- a/src/main/android/SDL_android_main.cpp	Mon Oct 31 03:06:32 2011 -0400
    46.2 +++ b/src/main/android/SDL_android_main.cpp	Mon Oct 31 05:56:58 2011 -0400
    46.3 @@ -1,3 +1,7 @@
    46.4 +
    46.5 +#include "SDL_config.h"
    46.6 +
    46.7 +#ifdef __ANDROID__
    46.8  
    46.9  /* Include the SDL main definition header */
   46.10  #include "SDL_main.h"
   46.11 @@ -33,4 +37,6 @@
   46.12      exit(status);
   46.13  }
   46.14  
   46.15 +#endif /* __ANDROID__ */
   46.16 +
   46.17  /* vi: set ts=4 sw=4 expandtab: */
    47.1 --- a/src/main/beos/SDL_BeApp.cc	Mon Oct 31 03:06:32 2011 -0400
    47.2 +++ b/src/main/beos/SDL_BeApp.cc	Mon Oct 31 05:56:58 2011 -0400
    47.3 @@ -20,6 +20,8 @@
    47.4  */
    47.5  #include "SDL_config.h"
    47.6  
    47.7 +#ifdef __BEOS__
    47.8 +
    47.9  /* Handle the BeApp specific portions of the application */
   47.10  
   47.11  #include <AppKit.h>
   47.12 @@ -116,8 +118,6 @@
   47.13      }
   47.14  }
   47.15  
   47.16 -
   47.17 -/* vi: set ts=4 sw=4 expandtab: */
   47.18  #ifdef __cplusplus
   47.19  }
   47.20  #endif
   47.21 @@ -131,3 +131,7 @@
   47.22  		--i;
   47.23  	}
   47.24  }
   47.25 +
   47.26 +#endif /* __BEOS__ */
   47.27 +
   47.28 +/* vi: set ts=4 sw=4 expandtab: */
    48.1 --- a/src/main/windows/SDL_windows_main.c	Mon Oct 31 03:06:32 2011 -0400
    48.2 +++ b/src/main/windows/SDL_windows_main.c	Mon Oct 31 05:56:58 2011 -0400
    48.3 @@ -3,6 +3,9 @@
    48.4  
    48.5      The WinMain function -- calls your program's main() function
    48.6  */
    48.7 +#include "SDL_config.h"
    48.8 +
    48.9 +#ifdef __WIN32__
   48.10  
   48.11  #include <stdio.h>
   48.12  #include <stdlib.h>
   48.13 @@ -202,4 +205,6 @@
   48.14      return 0;
   48.15  }
   48.16  
   48.17 +#endif /* __WIN32__ */
   48.18 +
   48.19  /* vi: set ts=4 sw=4 expandtab: */
    49.1 --- a/src/power/beos/SDL_syspower.c	Mon Oct 31 03:06:32 2011 -0400
    49.2 +++ b/src/power/beos/SDL_syspower.c	Mon Oct 31 05:56:58 2011 -0400
    49.3 @@ -21,7 +21,7 @@
    49.4  #include "SDL_config.h"
    49.5  
    49.6  #ifndef SDL_POWER_DISABLED
    49.7 -#ifdef SDL_POWER_BEOS
    49.8 +#if SDL_POWER_BEOS
    49.9  
   49.10  #include <stdio.h>
   49.11  #include <stdlib.h>
    50.1 --- a/src/power/linux/SDL_syspower.c	Mon Oct 31 03:06:32 2011 -0400
    50.2 +++ b/src/power/linux/SDL_syspower.c	Mon Oct 31 05:56:58 2011 -0400
    50.3 @@ -21,7 +21,7 @@
    50.4  #include "SDL_config.h"
    50.5  
    50.6  #ifndef SDL_POWER_DISABLED
    50.7 -#ifdef SDL_POWER_LINUX
    50.8 +#if SDL_POWER_LINUX
    50.9  
   50.10  #include <stdio.h>
   50.11  #include <unistd.h>
    51.1 --- a/src/power/macosx/SDL_syspower.c	Mon Oct 31 03:06:32 2011 -0400
    51.2 +++ b/src/power/macosx/SDL_syspower.c	Mon Oct 31 05:56:58 2011 -0400
    51.3 @@ -21,7 +21,7 @@
    51.4  #include "SDL_config.h"
    51.5  
    51.6  #ifndef SDL_POWER_DISABLED
    51.7 -#ifdef SDL_POWER_MACOSX
    51.8 +#if SDL_POWER_MACOSX
    51.9  
   51.10  #include <Carbon/Carbon.h>
   51.11  #include <IOKit/ps/IOPowerSources.h>
    52.1 --- a/src/power/nds/SDL_syspower.c	Mon Oct 31 03:06:32 2011 -0400
    52.2 +++ b/src/power/nds/SDL_syspower.c	Mon Oct 31 05:56:58 2011 -0400
    52.3 @@ -21,7 +21,7 @@
    52.4  #include "SDL_config.h"
    52.5  
    52.6  #ifndef SDL_POWER_DISABLED
    52.7 -#ifdef SDL_POWER_NINTENDODS
    52.8 +#if SDL_POWER_NINTENDODS
    52.9  
   52.10  #include "SDL_power.h"
   52.11  
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/src/power/uikit/SDL_syspower.h	Mon Oct 31 05:56:58 2011 -0400
    53.3 @@ -0,0 +1,32 @@
    53.4 +/*
    53.5 +  Simple DirectMedia Layer
    53.6 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    53.7 +
    53.8 +  This software is provided 'as-is', without any express or implied
    53.9 +  warranty.  In no event will the authors be held liable for any damages
   53.10 +  arising from the use of this software.
   53.11 +
   53.12 +  Permission is granted to anyone to use this software for any purpose,
   53.13 +  including commercial applications, and to alter it and redistribute it
   53.14 +  freely, subject to the following restrictions:
   53.15 +
   53.16 +  1. The origin of this software must not be misrepresented; you must not
   53.17 +     claim that you wrote the original software. If you use this software
   53.18 +     in a product, an acknowledgment in the product documentation would be
   53.19 +     appreciated but is not required.
   53.20 +  2. Altered source versions must be plainly marked as such, and must not be
   53.21 +     misrepresented as being the original software.
   53.22 +  3. This notice may not be removed or altered from any source distribution.
   53.23 +*/
   53.24 +#include "SDL_config.h"
   53.25 +
   53.26 +#if SDL_POWER_UIKIT
   53.27 +
   53.28 +#include "SDL_power.h"
   53.29 +
   53.30 +void SDL_UIKit_UpdateBatteryMonitoring(void);
   53.31 +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent);
   53.32 +
   53.33 +#endif /* SDL_POWER_UIKIT */
   53.34 +
   53.35 +/* vi: set ts=4 sw=4 expandtab: */
    54.1 --- a/src/power/uikit/SDL_syspower.m	Mon Oct 31 03:06:32 2011 -0400
    54.2 +++ b/src/power/uikit/SDL_syspower.m	Mon Oct 31 05:56:58 2011 -0400
    54.3 @@ -21,13 +21,14 @@
    54.4  #include "SDL_config.h"
    54.5  
    54.6  #ifndef SDL_POWER_DISABLED
    54.7 -#ifdef SDL_POWER_UIKIT
    54.8 +#if SDL_POWER_UIKIT
    54.9  
   54.10  #import <UIKit/UIKit.h>
   54.11  
   54.12  #include "SDL_power.h"
   54.13  #include "SDL_timer.h"
   54.14  #include "SDL_assert.h"
   54.15 +#include "SDL_syspower.h"
   54.16  
   54.17  // turn off the battery monitor if it's been more than X ms since last check.
   54.18  static const int BATTERY_MONITORING_TIMEOUT = 3000;
    55.1 --- a/src/power/windows/SDL_syspower.c	Mon Oct 31 03:06:32 2011 -0400
    55.2 +++ b/src/power/windows/SDL_syspower.c	Mon Oct 31 05:56:58 2011 -0400
    55.3 @@ -21,7 +21,7 @@
    55.4  #include "SDL_config.h"
    55.5  
    55.6  #ifndef SDL_POWER_DISABLED
    55.7 -#ifdef SDL_POWER_WINDOWS
    55.8 +#if SDL_POWER_WINDOWS
    55.9  
   55.10  #include "../../core/windows/SDL_windows.h"
   55.11  
    56.1 --- a/src/render/SDL_render.c	Mon Oct 31 03:06:32 2011 -0400
    56.2 +++ b/src/render/SDL_render.c	Mon Oct 31 05:56:58 2011 -0400
    56.3 @@ -745,7 +745,7 @@
    56.4      SDL_UnlockTexture(native);
    56.5  }
    56.6  
    56.7 -void
    56.8 +static void
    56.9  SDL_UnlockTextureNative(SDL_Texture * texture)
   56.10  {
   56.11      SDL_Texture *native = texture->native;
    57.1 --- a/src/render/opengles/SDL_render_gles.c	Mon Oct 31 03:06:32 2011 -0400
    57.2 +++ b/src/render/opengles/SDL_render_gles.c	Mon Oct 31 05:56:58 2011 -0400
    57.3 @@ -581,7 +581,6 @@
    57.4  GLES_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
    57.5                        int count)
    57.6  {
    57.7 -    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
    57.8      int i;
    57.9      GLshort *vertices;
   57.10  
   57.11 @@ -603,7 +602,6 @@
   57.12  GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
   57.13                       int count)
   57.14  {
   57.15 -    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   57.16      int i;
   57.17      GLshort *vertices;
   57.18  
   57.19 @@ -632,7 +630,6 @@
   57.20  GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect * rects,
   57.21                       int count)
   57.22  {
   57.23 -    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   57.24      int i;
   57.25  
   57.26      GLES_SetDrawingState(renderer);
    58.1 --- a/src/render/opengles2/SDL_render_gles2.c	Mon Oct 31 03:06:32 2011 -0400
    58.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Mon Oct 31 05:56:58 2011 -0400
    58.3 @@ -877,7 +877,6 @@
    58.4  static int
    58.5  GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count)
    58.6  {
    58.7 -    GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
    58.8      GLfloat *vertices;
    58.9      int idx;
   58.10  
   58.11 @@ -910,7 +909,6 @@
   58.12  static int
   58.13  GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count)
   58.14  {
   58.15 -    GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
   58.16      GLfloat *vertices;
   58.17      int idx;
   58.18  
   58.19 @@ -943,7 +941,6 @@
   58.20  static int
   58.21  GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count)
   58.22  {
   58.23 -    GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
   58.24      GLfloat vertices[8];
   58.25      int idx;
   58.26  
    59.1 --- a/src/render/software/SDL_render_sw.c	Mon Oct 31 03:06:32 2011 -0400
    59.2 +++ b/src/render/software/SDL_render_sw.c	Mon Oct 31 05:56:58 2011 -0400
    59.3 @@ -23,6 +23,7 @@
    59.4  #if !SDL_RENDER_DISABLED
    59.5  
    59.6  #include "../SDL_sysrender.h"
    59.7 +#include "SDL_render_sw_c.h"
    59.8  
    59.9  #include "SDL_draw.h"
   59.10  #include "SDL_blendfillrect.h"
    60.1 --- a/src/stdlib/SDL_string.c	Mon Oct 31 03:06:32 2011 -0400
    60.2 +++ b/src/stdlib/SDL_string.c	Mon Oct 31 05:56:58 2011 -0400
    60.3 @@ -31,7 +31,7 @@
    60.4  #define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
    60.5  #define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
    60.6  
    60.7 -int UTF8_TrailingBytes(unsigned char c)
    60.8 +static int UTF8_TrailingBytes(unsigned char c)
    60.9  {
   60.10      if (c >= 0xC0 && c <= 0xDF)
   60.11          return 1;
    61.1 --- a/src/thread/SDL_thread.c	Mon Oct 31 03:06:32 2011 -0400
    61.2 +++ b/src/thread/SDL_thread.c	Mon Oct 31 05:56:58 2011 -0400
    61.3 @@ -26,6 +26,7 @@
    61.4  #include "SDL_thread.h"
    61.5  #include "SDL_thread_c.h"
    61.6  #include "SDL_systhread.h"
    61.7 +#include "../SDL_error_c.h"
    61.8  
    61.9  #define ARRAY_CHUNKSIZE	32
   61.10  /* The array of threads currently active in the application
    62.1 --- a/src/thread/SDL_thread_c.h	Mon Oct 31 03:06:32 2011 -0400
    62.2 +++ b/src/thread/SDL_thread_c.h	Mon Oct 31 05:56:58 2011 -0400
    62.3 @@ -32,8 +32,6 @@
    62.4  #include "epoc/SDL_systhread_c.h"
    62.5  #elif SDL_THREAD_PTHREAD
    62.6  #include "pthread/SDL_systhread_c.h"
    62.7 -#elif SDL_THREAD_SPROC
    62.8 -#include "irix/SDL_systhread_c.h"
    62.9  #elif SDL_THREAD_WINDOWS
   62.10  #include "windows/SDL_systhread_c.h"
   62.11  #elif SDL_THREAD_NDS
   62.12 @@ -59,4 +57,5 @@
   62.13  extern void SDL_RunThread(void *data);
   62.14  
   62.15  #endif /* _SDL_thread_c_h */
   62.16 +
   62.17  /* vi: set ts=4 sw=4 expandtab: */
    63.1 --- a/src/thread/beos/SDL_syssem.c	Mon Oct 31 03:06:32 2011 -0400
    63.2 +++ b/src/thread/beos/SDL_syssem.c	Mon Oct 31 05:56:58 2011 -0400
    63.3 @@ -20,6 +20,8 @@
    63.4  */
    63.5  #include "SDL_config.h"
    63.6  
    63.7 +#ifdef SDL_THREAD_BEOS
    63.8 +
    63.9  /* Semaphores in the BeOS environment */
   63.10  
   63.11  #include <be/kernel/OS.h>
   63.12 @@ -148,4 +150,6 @@
   63.13      return 0;
   63.14  }
   63.15  
   63.16 +#endif /* SDL_THREAD_BEOS */
   63.17 +
   63.18  /* vi: set ts=4 sw=4 expandtab: */
    64.1 --- a/src/thread/beos/SDL_systhread.c	Mon Oct 31 03:06:32 2011 -0400
    64.2 +++ b/src/thread/beos/SDL_systhread.c	Mon Oct 31 05:56:58 2011 -0400
    64.3 @@ -20,6 +20,8 @@
    64.4  */
    64.5  #include "SDL_config.h"
    64.6  
    64.7 +#ifdef SDL_THREAD_BEOS
    64.8 +
    64.9  /* BeOS thread management routines for SDL */
   64.10  
   64.11  #include <stdio.h>
   64.12 @@ -120,4 +122,6 @@
   64.13      wait_for_thread(thread->handle, &the_status);
   64.14  }
   64.15  
   64.16 +#endif /* SDL_THREAD_BEOS */
   64.17 +
   64.18  /* vi: set ts=4 sw=4 expandtab: */
    65.1 --- a/src/thread/irix/SDL_syssem.c	Mon Oct 31 03:06:32 2011 -0400
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,230 +0,0 @@
    65.4 -/*
    65.5 -  Simple DirectMedia Layer
    65.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    65.7 -
    65.8 -  This software is provided 'as-is', without any express or implied
    65.9 -  warranty.  In no event will the authors be held liable for any damages
   65.10 -  arising from the use of this software.
   65.11 -
   65.12 -  Permission is granted to anyone to use this software for any purpose,
   65.13 -  including commercial applications, and to alter it and redistribute it
   65.14 -  freely, subject to the following restrictions:
   65.15 -
   65.16 -  1. The origin of this software must not be misrepresented; you must not
   65.17 -     claim that you wrote the original software. If you use this software
   65.18 -     in a product, an acknowledgment in the product documentation would be
   65.19 -     appreciated but is not required.
   65.20 -  2. Altered source versions must be plainly marked as such, and must not be
   65.21 -     misrepresented as being the original software.
   65.22 -  3. This notice may not be removed or altered from any source distribution.
   65.23 -*/
   65.24 -#include "SDL_config.h"
   65.25 -
   65.26 -#include "SDL_thread.h"
   65.27 -#include "SDL_timer.h"
   65.28 -
   65.29 -
   65.30 -#include <stdio.h>
   65.31 -#include <stdlib.h>
   65.32 -#include <sys/types.h>
   65.33 -#include <sys/ipc.h>
   65.34 -#include <sys/sem.h>
   65.35 -#include <errno.h>
   65.36 -
   65.37 -#include "SDL_error.h"
   65.38 -#include "SDL_thread.h"
   65.39 -
   65.40 -
   65.41 -struct SDL_semaphore
   65.42 -{
   65.43 -    int id;
   65.44 -};
   65.45 -
   65.46 -/* Not defined by many operating systems, use configure to detect */
   65.47 -/*
   65.48 -#if !defined(HAVE_SEMUN)
   65.49 -union semun {
   65.50 -	int val;
   65.51 -	struct semid_ds *buf;
   65.52 -	ushort *array;
   65.53 -};
   65.54 -#endif
   65.55 -*/
   65.56 -
   65.57 -static struct sembuf op_trywait[2] = {
   65.58 -    {0, -1, (IPC_NOWAIT | SEM_UNDO)}    /* Decrement semaphore, no block */
   65.59 -};
   65.60 -
   65.61 -static struct sembuf op_wait[2] = {
   65.62 -    {0, -1, SEM_UNDO}           /* Decrement semaphore */
   65.63 -};
   65.64 -
   65.65 -static struct sembuf op_post[1] = {
   65.66 -    {0, 1, (IPC_NOWAIT | SEM_UNDO)}     /* Increment semaphore */
   65.67 -};
   65.68 -
   65.69 -/* Create a blockable semaphore */
   65.70 -SDL_sem *
   65.71 -SDL_CreateSemaphore(Uint32 initial_value)
   65.72 -{
   65.73 -    extern int _creating_thread_lock;   /* SDL_threads.c */
   65.74 -    SDL_sem *sem;
   65.75 -    union semun init;
   65.76 -
   65.77 -    sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
   65.78 -    if (sem == NULL) {
   65.79 -        SDL_OutOfMemory();
   65.80 -        return (NULL);
   65.81 -    }
   65.82 -    sem->id = semget(IPC_PRIVATE, 1, (0600 | IPC_CREAT));
   65.83 -    if (sem->id < 0) {
   65.84 -        SDL_SetError("Couldn't create semaphore");
   65.85 -        SDL_free(sem);
   65.86 -        return (NULL);
   65.87 -    }
   65.88 -    init.val = initial_value;   /* Initialize semaphore */
   65.89 -    semctl(sem->id, 0, SETVAL, init);
   65.90 -    return (sem);
   65.91 -}
   65.92 -
   65.93 -void
   65.94 -SDL_DestroySemaphore(SDL_sem * sem)
   65.95 -{
   65.96 -    if (sem) {
   65.97 -#ifdef __IRIX__
   65.98 -        semctl(sem->id, 0, IPC_RMID);
   65.99 -#else
  65.100 -        union semun dummy;
  65.101 -        dummy.val = 0;
  65.102 -        semctl(sem->id, 0, IPC_RMID, dummy);
  65.103 -#endif
  65.104 -        SDL_free(sem);
  65.105 -    }
  65.106 -}
  65.107 -
  65.108 -int
  65.109 -SDL_SemTryWait(SDL_sem * sem)
  65.110 -{
  65.111 -    int retval;
  65.112 -
  65.113 -    if (!sem) {
  65.114 -        SDL_SetError("Passed a NULL semaphore");
  65.115 -        return -1;
  65.116 -    }
  65.117 -
  65.118 -    retval = 0;
  65.119 -  tryagain:
  65.120 -    if (semop(sem->id, op_trywait, 1) < 0) {
  65.121 -        if (errno == EINTR) {
  65.122 -            goto tryagain;
  65.123 -        }
  65.124 -        retval = SDL_MUTEX_TIMEDOUT;
  65.125 -    }
  65.126 -    return retval;
  65.127 -}
  65.128 -
  65.129 -int
  65.130 -SDL_SemWait(SDL_sem * sem)
  65.131 -{
  65.132 -    int retval;
  65.133 -
  65.134 -    if (!sem) {
  65.135 -        SDL_SetError("Passed a NULL semaphore");
  65.136 -        return -1;
  65.137 -    }
  65.138 -
  65.139 -    retval = 0;
  65.140 -  tryagain:
  65.141 -    if (semop(sem->id, op_wait, 1) < 0) {
  65.142 -        if (errno == EINTR) {
  65.143 -            goto tryagain;
  65.144 -        }
  65.145 -        SDL_SetError("Semaphore operation error");
  65.146 -        retval = -1;
  65.147 -    }
  65.148 -    return retval;
  65.149 -}
  65.150 -
  65.151 -int
  65.152 -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
  65.153 -{
  65.154 -    int retval;
  65.155 -
  65.156 -    if (!sem) {
  65.157 -        SDL_SetError("Passed a NULL semaphore");
  65.158 -        return -1;
  65.159 -    }
  65.160 -
  65.161 -    /* Try the easy cases first */
  65.162 -    if (timeout == 0) {
  65.163 -        return SDL_SemTryWait(sem);
  65.164 -    }
  65.165 -    if (timeout == SDL_MUTEX_MAXWAIT) {
  65.166 -        return SDL_SemWait(sem);
  65.167 -    }
  65.168 -
  65.169 -    /* Ack!  We have to busy wait... */
  65.170 -    timeout += SDL_GetTicks();
  65.171 -    do {
  65.172 -        retval = SDL_SemTryWait(sem);
  65.173 -        if (retval == 0) {
  65.174 -            break;
  65.175 -        }
  65.176 -        SDL_Delay(1);
  65.177 -    } while (SDL_GetTicks() < timeout);
  65.178 -
  65.179 -    return retval;
  65.180 -}
  65.181 -
  65.182 -Uint32
  65.183 -SDL_SemValue(SDL_sem * sem)
  65.184 -{
  65.185 -    int semval;
  65.186 -    Uint32 value;
  65.187 -
  65.188 -    value = 0;
  65.189 -    if (sem) {
  65.190 -      tryagain:
  65.191 -#ifdef __IRIX__
  65.192 -        semval = semctl(sem->id, 0, GETVAL);
  65.193 -#else
  65.194 -        {
  65.195 -            union semun arg;
  65.196 -            arg.val = 0;
  65.197 -            semval = semctl(sem->id, 0, GETVAL, arg);
  65.198 -        }
  65.199 -#endif
  65.200 -        if (semval < 0) {
  65.201 -            if (errno == EINTR) {
  65.202 -                goto tryagain;
  65.203 -            }
  65.204 -        } else {
  65.205 -            value = (Uint32) semval;
  65.206 -        }
  65.207 -    }
  65.208 -    return value;
  65.209 -}
  65.210 -
  65.211 -int
  65.212 -SDL_SemPost(SDL_sem * sem)
  65.213 -{
  65.214 -    int retval;
  65.215 -
  65.216 -    if (!sem) {
  65.217 -        SDL_SetError("Passed a NULL semaphore");
  65.218 -        return -1;
  65.219 -    }
  65.220 -
  65.221 -    retval = 0;
  65.222 -  tryagain:
  65.223 -    if (semop(sem->id, op_post, 1) < 0) {
  65.224 -        if (errno == EINTR) {
  65.225 -            goto tryagain;
  65.226 -        }
  65.227 -        SDL_SetError("Semaphore operation error");
  65.228 -        retval = -1;
  65.229 -    }
  65.230 -    return retval;
  65.231 -}
  65.232 -
  65.233 -/* vi: set ts=4 sw=4 expandtab: */
    66.1 --- a/src/thread/irix/SDL_systhread.c	Mon Oct 31 03:06:32 2011 -0400
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,81 +0,0 @@
    66.4 -/*
    66.5 -  Simple DirectMedia Layer
    66.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    66.7 -
    66.8 -  This software is provided 'as-is', without any express or implied
    66.9 -  warranty.  In no event will the authors be held liable for any damages
   66.10 -  arising from the use of this software.
   66.11 -
   66.12 -  Permission is granted to anyone to use this software for any purpose,
   66.13 -  including commercial applications, and to alter it and redistribute it
   66.14 -  freely, subject to the following restrictions:
   66.15 -
   66.16 -  1. The origin of this software must not be misrepresented; you must not
   66.17 -     claim that you wrote the original software. If you use this software
   66.18 -     in a product, an acknowledgment in the product documentation would be
   66.19 -     appreciated but is not required.
   66.20 -  2. Altered source versions must be plainly marked as such, and must not be
   66.21 -     misrepresented as being the original software.
   66.22 -  3. This notice may not be removed or altered from any source distribution.
   66.23 -*/
   66.24 -#include "SDL_config.h"
   66.25 -
   66.26 -/* IRIX thread management routines for SDL */
   66.27 -
   66.28 -#include <errno.h>
   66.29 -#include <signal.h>
   66.30 -#include <sys/types.h>
   66.31 -#include <sys/wait.h>
   66.32 -#include <sys/prctl.h>
   66.33 -
   66.34 -#include "SDL_thread.h"
   66.35 -#include "../SDL_systhread.h"
   66.36 -
   66.37 -
   66.38 -static int sig_list[] = {
   66.39 -    SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCLD, SIGWINCH,
   66.40 -    SIGVTALRM, SIGPROF, 0
   66.41 -};
   66.42 -
   66.43 -
   66.44 -int
   66.45 -SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
   66.46 -{
   66.47 -    /* Create the thread and go! */
   66.48 -    if (sproc(SDL_RunThread, PR_SALL, args) < 0) {
   66.49 -        SDL_SetError("Not enough resources to create thread");
   66.50 -        return (-1);
   66.51 -    }
   66.52 -    return (0);
   66.53 -}
   66.54 -
   66.55 -void
   66.56 -SDL_SYS_SetupThread(const char *name)
   66.57 -{
   66.58 -    int i;
   66.59 -    sigset_t mask;
   66.60 -
   66.61 -    /* Mask asynchronous signals for this thread */
   66.62 -    sigemptyset(&mask);
   66.63 -    for (i = 0; sig_list[i]; ++i) {
   66.64 -        sigaddset(&mask, sig_list[i]);
   66.65 -    }
   66.66 -    sigprocmask(SIG_BLOCK, &mask, NULL);
   66.67 -}
   66.68 -
   66.69 -SDL_threadID
   66.70 -SDL_ThreadID(void)
   66.71 -{
   66.72 -    return ((SDL_threadID) getpid());
   66.73 -}
   66.74 -
   66.75 -void
   66.76 -SDL_WaitThread(SDL_Thread * thread, int *status)
   66.77 -{
   66.78 -    errno = 0;
   66.79 -    while (errno != ECHILD) {
   66.80 -        waitpid(thread->handle, NULL, 0);
   66.81 -    }
   66.82 -}
   66.83 -
   66.84 -/* vi: set ts=4 sw=4 expandtab: */
    67.1 --- a/src/thread/irix/SDL_systhread_c.h	Mon Oct 31 03:06:32 2011 -0400
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,27 +0,0 @@
    67.4 -/*
    67.5 -  Simple DirectMedia Layer
    67.6 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
    67.7 -
    67.8 -  This software is provided 'as-is', without any express or implied
    67.9 -  warranty.  In no event will the authors be held liable for any damages
   67.10 -  arising from the use of this software.
   67.11 -
   67.12 -  Permission is granted to anyone to use this software for any purpose,
   67.13 -  including commercial applications, and to alter it and redistribute it
   67.14 -  freely, subject to the following restrictions:
   67.15 -
   67.16 -  1. The origin of this software must not be misrepresented; you must not
   67.17 -     claim that you wrote the original software. If you use this software
   67.18 -     in a product, an acknowledgment in the product documentation would be
   67.19 -     appreciated but is not required.
   67.20 -  2. Altered source versions must be plainly marked as such, and must not be
   67.21 -     misrepresented as being the original software.
   67.22 -  3. This notice may not be removed or altered from any source distribution.
   67.23 -*/
   67.24 -#include "SDL_config.h"
   67.25 -
   67.26 -#include <sys/types.h>
   67.27 -
   67.28 -typedef pid_t SYS_ThreadHandle;
   67.29 -
   67.30 -/* vi: set ts=4 sw=4 expandtab: */
    68.1 --- a/src/thread/nds/SDL_systhread.c	Mon Oct 31 03:06:32 2011 -0400
    68.2 +++ b/src/thread/nds/SDL_systhread.c	Mon Oct 31 05:56:58 2011 -0400
    68.3 @@ -61,10 +61,4 @@
    68.4      return (0);
    68.5  }
    68.6  
    68.7 -void
    68.8 -SDL_SYS_KillThread(SDL_Thread * thread)
    68.9 -{
   68.10 -    return;
   68.11 -}
   68.12 -
   68.13  /* vi: set ts=4 sw=4 expandtab: */
    69.1 --- a/src/thread/windows/SDL_sysmutex.c	Mon Oct 31 03:06:32 2011 -0400
    69.2 +++ b/src/thread/windows/SDL_sysmutex.c	Mon Oct 31 05:56:58 2011 -0400
    69.3 @@ -20,6 +20,8 @@
    69.4  */
    69.5  #include "SDL_config.h"
    69.6  
    69.7 +#if SDL_THREAD_WINDOWS
    69.8 +
    69.9  /* Mutex functions using the Win32 API */
   69.10  
   69.11  #include "../../core/windows/SDL_windows.h"
   69.12 @@ -90,4 +92,6 @@
   69.13      return (0);
   69.14  }
   69.15  
   69.16 +#endif /* SDL_THREAD_WINDOWS */
   69.17 +
   69.18  /* vi: set ts=4 sw=4 expandtab: */
    70.1 --- a/src/thread/windows/SDL_syssem.c	Mon Oct 31 03:06:32 2011 -0400
    70.2 +++ b/src/thread/windows/SDL_syssem.c	Mon Oct 31 05:56:58 2011 -0400
    70.3 @@ -20,6 +20,8 @@
    70.4  */
    70.5  #include "SDL_config.h"
    70.6  
    70.7 +#if SDL_THREAD_WINDOWS
    70.8 +
    70.9  /* Semaphore functions using the Win32 API */
   70.10  
   70.11  #include "../../core/windows/SDL_windows.h"
   70.12 @@ -169,4 +171,6 @@
   70.13      return 0;
   70.14  }
   70.15  
   70.16 +#endif /* SDL_THREAD_WINDOWS */
   70.17 +
   70.18  /* vi: set ts=4 sw=4 expandtab: */
    71.1 --- a/src/thread/windows/SDL_systhread.c	Mon Oct 31 03:06:32 2011 -0400
    71.2 +++ b/src/thread/windows/SDL_systhread.c	Mon Oct 31 05:56:58 2011 -0400
    71.3 @@ -20,6 +20,8 @@
    71.4  */
    71.5  #include "SDL_config.h"
    71.6  
    71.7 +#if SDL_THREAD_WINDOWS
    71.8 +
    71.9  /* Win32 thread management routines for SDL */
   71.10  
   71.11  #include "SDL_thread.h"
   71.12 @@ -216,4 +218,6 @@
   71.13      CloseHandle(thread->handle);
   71.14  }
   71.15  
   71.16 +#endif /* SDL_THREAD_WINDOWS */
   71.17 +
   71.18  /* vi: set ts=4 sw=4 expandtab: */
    72.1 --- a/src/thread/windows/win_ce_semaphore.c	Mon Oct 31 03:06:32 2011 -0400
    72.2 +++ b/src/thread/windows/win_ce_semaphore.c	Mon Oct 31 05:56:58 2011 -0400
    72.3 @@ -26,7 +26,11 @@
    72.4     6. The wait function emulates WaitForSingleObject only. An emulation of
    72.5        WaitForMultipleObjects is much harder to implement outside the kernel,
    72.6        and it is not clear how to handle a mixture of WCE semaphores and normal
    72.7 -      events and mutexes. */
    72.8 +      events and mutexes.
    72.9 +*/
   72.10 +#include "SDL_config.h"
   72.11 +
   72.12 +#if SDL_THREAD_WINDOWS
   72.13  
   72.14  #include "../../core/windows/SDL_windows.h"
   72.15  
   72.16 @@ -224,4 +228,6 @@
   72.17      return hSynch;
   72.18  }
   72.19  
   72.20 +#endif /* SDL_THREAD_WINDOWS */
   72.21 +
   72.22  /* vi: set ts=4 sw=4 expandtab: */
    73.1 --- a/src/video/SDL_rect.c	Mon Oct 31 03:06:32 2011 -0400
    73.2 +++ b/src/video/SDL_rect.c	Mon Oct 31 05:56:58 2011 -0400
    73.3 @@ -21,6 +21,7 @@
    73.4  #include "SDL_config.h"
    73.5  
    73.6  #include "SDL_rect.h"
    73.7 +#include "SDL_rect_c.h"
    73.8  
    73.9  
   73.10  SDL_bool
    74.1 --- a/src/video/SDL_shape.c	Mon Oct 31 03:06:32 2011 -0400
    74.2 +++ b/src/video/SDL_shape.c	Mon Oct 31 05:56:58 2011 -0400
    74.3 @@ -115,7 +115,7 @@
    74.4          SDL_UnlockSurface(shape);
    74.5  }
    74.6  
    74.7 -SDL_ShapeTree*
    74.8 +static SDL_ShapeTree*
    74.9  RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rect dimensions) {
   74.10      int x = 0,y = 0;
   74.11      Uint8* pixel = NULL;
   74.12 @@ -249,7 +249,7 @@
   74.13      return result;
   74.14  }
   74.15  
   74.16 -SDL_bool
   74.17 +static SDL_bool
   74.18  SDL_WindowHasAShape(SDL_Window *window) {
   74.19      if (window == NULL || !SDL_IsShapedWindow(window))
   74.20          return SDL_FALSE;
    75.1 --- a/src/video/SDL_video.c	Mon Oct 31 03:06:32 2011 -0400
    75.2 +++ b/src/video/SDL_video.c	Mon Oct 31 05:56:58 2011 -0400
    75.3 @@ -576,7 +576,7 @@
    75.4      return _this->num_displays;
    75.5  }
    75.6  
    75.7 -int
    75.8 +static int
    75.9  SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
   75.10  {
   75.11      int displayIndex;
   75.12 @@ -655,12 +655,6 @@
   75.13      return SDL_TRUE;
   75.14  }
   75.15  
   75.16 -SDL_VideoDisplay *
   75.17 -SDL_GetFirstDisplay(void)
   75.18 -{
   75.19 -    return &_this->displays[0];
   75.20 -}
   75.21 -
   75.22  static int
   75.23  SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display)
   75.24  {
   75.25 @@ -847,7 +841,7 @@
   75.26      return SDL_GetClosestDisplayModeForDisplay(display, mode, closest);
   75.27  }
   75.28  
   75.29 -int
   75.30 +static int
   75.31  SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode)
   75.32  {
   75.33      SDL_DisplayMode display_mode;
    76.1 --- a/src/video/android/SDL_androidevents.c	Mon Oct 31 03:06:32 2011 -0400
    76.2 +++ b/src/video/android/SDL_androidevents.c	Mon Oct 31 05:56:58 2011 -0400
    76.3 @@ -20,6 +20,8 @@
    76.4  */
    76.5  #include "SDL_config.h"
    76.6  
    76.7 +#if SDL_VIDEO_DRIVER_ANDROID
    76.8 +
    76.9  #include "SDL_androidevents.h"
   76.10  
   76.11  void
   76.12 @@ -28,4 +30,6 @@
   76.13      /* No polling necessary */
   76.14  }
   76.15  
   76.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   76.17 +
   76.18  /* vi: set ts=4 sw=4 expandtab: */
    77.1 --- a/src/video/android/SDL_androidgl.c	Mon Oct 31 03:06:32 2011 -0400
    77.2 +++ b/src/video/android/SDL_androidgl.c	Mon Oct 31 05:56:58 2011 -0400
    77.3 @@ -20,6 +20,8 @@
    77.4  */
    77.5  #include "SDL_config.h"
    77.6  
    77.7 +#if SDL_VIDEO_DRIVER_ANDROID
    77.8 +
    77.9  /* Android SDL video driver implementation */
   77.10  
   77.11  #include "SDL_video.h"
   77.12 @@ -112,4 +114,6 @@
   77.13      __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
   77.14  }
   77.15  
   77.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   77.17 +
   77.18  /* vi: set ts=4 sw=4 expandtab: */
    78.1 --- a/src/video/android/SDL_androidkeyboard.c	Mon Oct 31 03:06:32 2011 -0400
    78.2 +++ b/src/video/android/SDL_androidkeyboard.c	Mon Oct 31 05:56:58 2011 -0400
    78.3 @@ -20,6 +20,8 @@
    78.4  */
    78.5  #include "SDL_config.h"
    78.6  
    78.7 +#if SDL_VIDEO_DRIVER_ANDROID
    78.8 +
    78.9  #include <android/log.h>
   78.10  
   78.11  #include "../../events/SDL_events_c.h"
   78.12 @@ -176,4 +178,6 @@
   78.13      return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode));
   78.14  }
   78.15  
   78.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   78.17 +
   78.18  /* vi: set ts=4 sw=4 expandtab: */
    79.1 --- a/src/video/android/SDL_androidtouch.c	Mon Oct 31 03:06:32 2011 -0400
    79.2 +++ b/src/video/android/SDL_androidtouch.c	Mon Oct 31 05:56:58 2011 -0400
    79.3 @@ -20,6 +20,8 @@
    79.4  */
    79.5  #include "SDL_config.h"
    79.6  
    79.7 +#if SDL_VIDEO_DRIVER_ANDROID
    79.8 +
    79.9  #include <android/log.h>
   79.10  
   79.11  #include "SDL_events.h"
   79.12 @@ -85,4 +87,6 @@
   79.13      } 
   79.14  }
   79.15  
   79.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   79.17 +
   79.18  /* vi: set ts=4 sw=4 expandtab: */
    80.1 --- a/src/video/android/SDL_androidvideo.c	Mon Oct 31 03:06:32 2011 -0400
    80.2 +++ b/src/video/android/SDL_androidvideo.c	Mon Oct 31 05:56:58 2011 -0400
    80.3 @@ -20,6 +20,8 @@
    80.4  */
    80.5  #include "SDL_config.h"
    80.6  
    80.7 +#if SDL_VIDEO_DRIVER_ANDROID
    80.8 +
    80.9  /* Android SDL video driver implementation
   80.10  */
   80.11  
   80.12 @@ -166,4 +168,6 @@
   80.13      }
   80.14  }
   80.15  
   80.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   80.17 +
   80.18  /* vi: set ts=4 sw=4 expandtab: */
    81.1 --- a/src/video/android/SDL_androidwindow.c	Mon Oct 31 03:06:32 2011 -0400
    81.2 +++ b/src/video/android/SDL_androidwindow.c	Mon Oct 31 05:56:58 2011 -0400
    81.3 @@ -20,6 +20,8 @@
    81.4  */
    81.5  #include "SDL_config.h"
    81.6  
    81.7 +#if SDL_VIDEO_DRIVER_ANDROID
    81.8 +
    81.9  #include "../SDL_sysvideo.h"
   81.10  
   81.11  #include "SDL_androidvideo.h"
   81.12 @@ -62,4 +64,6 @@
   81.13      }
   81.14  }
   81.15  
   81.16 +#endif /* SDL_VIDEO_DRIVER_ANDROID */
   81.17 +
   81.18  /* vi: set ts=4 sw=4 expandtab: */
    82.1 --- a/src/video/bwindow/SDL_bclipboard.cc	Mon Oct 31 03:06:32 2011 -0400
    82.2 +++ b/src/video/bwindow/SDL_bclipboard.cc	Mon Oct 31 05:56:58 2011 -0400
    82.3 @@ -18,10 +18,11 @@
    82.4       misrepresented as being the original software.
    82.5    3. This notice may not be removed or altered from any source distribution.
    82.6  */
    82.7 +#include "SDL_config.h"
    82.8  
    82.9 +#if SDL_VIDEO_DRIVER_BWINDOW
   82.10  
   82.11  /* BWindow based framebuffer implementation */
   82.12 -#include "SDL_config.h"
   82.13  
   82.14  #include <unistd.h>
   82.15  #include <TypeConstants.h>
   82.16 @@ -91,3 +92,4 @@
   82.17  }					/* Extern C */
   82.18  #endif
   82.19  
   82.20 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    83.1 --- a/src/video/bwindow/SDL_bevents.cc	Mon Oct 31 03:06:32 2011 -0400
    83.2 +++ b/src/video/bwindow/SDL_bevents.cc	Mon Oct 31 05:56:58 2011 -0400
    83.3 @@ -18,6 +18,9 @@
    83.4       misrepresented as being the original software.
    83.5    3. This notice may not be removed or altered from any source distribution.
    83.6  */
    83.7 +#include "SDL_config.h"
    83.8 +
    83.9 +#if SDL_VIDEO_DRIVER_BWINDOW
   83.10  
   83.11  #include "SDL_bevents.h"
   83.12  
   83.13 @@ -32,3 +35,5 @@
   83.14  #ifdef __cplusplus
   83.15  }
   83.16  #endif
   83.17 +
   83.18 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    84.1 --- a/src/video/bwindow/SDL_bframebuffer.cc	Mon Oct 31 03:06:32 2011 -0400
    84.2 +++ b/src/video/bwindow/SDL_bframebuffer.cc	Mon Oct 31 05:56:58 2011 -0400
    84.3 @@ -18,6 +18,9 @@
    84.4       misrepresented as being the original software.
    84.5    3. This notice may not be removed or altered from any source distribution.
    84.6  */
    84.7 +#include "SDL_config.h"
    84.8 +
    84.9 +#if SDL_VIDEO_DRIVER_BWINDOW
   84.10  
   84.11  #include "SDL_bframebuffer.h"
   84.12  
   84.13 @@ -248,3 +251,5 @@
   84.14  #ifdef __cplusplus
   84.15  }
   84.16  #endif
   84.17 +
   84.18 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    85.1 --- a/src/video/bwindow/SDL_bkeyboard.cc	Mon Oct 31 03:06:32 2011 -0400
    85.2 +++ b/src/video/bwindow/SDL_bkeyboard.cc	Mon Oct 31 05:56:58 2011 -0400
    85.3 @@ -19,6 +19,9 @@
    85.4      Sam Lantinga
    85.5      slouken@libsdl.org
    85.6  */
    85.7 +#include "SDL_config.h"
    85.8 +
    85.9 +#if SDL_VIDEO_DRIVER_BWINDOW
   85.10  
   85.11  #include <SupportDefs.h>
   85.12  #include <support/UTF8.h>
   85.13 @@ -182,3 +185,5 @@
   85.14  #ifdef __cplusplus
   85.15  }
   85.16  #endif
   85.17 +
   85.18 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    86.1 --- a/src/video/bwindow/SDL_bmodes.cc	Mon Oct 31 03:06:32 2011 -0400
    86.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Mon Oct 31 05:56:58 2011 -0400
    86.3 @@ -18,8 +18,9 @@
    86.4       misrepresented as being the original software.
    86.5    3. This notice may not be removed or altered from any source distribution.
    86.6  */
    86.7 +#include "SDL_config.h"
    86.8  
    86.9 -
   86.10 +#if SDL_VIDEO_DRIVER_BWINDOW
   86.11  
   86.12  #include <AppKit.h>
   86.13  #include <InterfaceKit.h>
   86.14 @@ -327,3 +328,5 @@
   86.15  #ifdef __cplusplus
   86.16  }
   86.17  #endif
   86.18 +
   86.19 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    87.1 --- a/src/video/bwindow/SDL_bopengl.cc	Mon Oct 31 03:06:32 2011 -0400
    87.2 +++ b/src/video/bwindow/SDL_bopengl.cc	Mon Oct 31 05:56:58 2011 -0400
    87.3 @@ -18,6 +18,9 @@
    87.4       misrepresented as being the original software.
    87.5    3. This notice may not be removed or altered from any source distribution.
    87.6  */
    87.7 +#include "SDL_config.h"
    87.8 +
    87.9 +#if SDL_VIDEO_DRIVER_BWINDOW
   87.10  
   87.11  #include "SDL_bopengl.h"
   87.12  
   87.13 @@ -209,11 +212,8 @@
   87.14  
   87.15  
   87.16  
   87.17 -
   87.18 -
   87.19 -
   87.20 -
   87.21 -
   87.22  #ifdef __cplusplus
   87.23  }
   87.24  #endif
   87.25 +
   87.26 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    88.1 --- a/src/video/bwindow/SDL_bvideo.cc	Mon Oct 31 03:06:32 2011 -0400
    88.2 +++ b/src/video/bwindow/SDL_bvideo.cc	Mon Oct 31 05:56:58 2011 -0400
    88.3 @@ -18,8 +18,9 @@
    88.4       misrepresented as being the original software.
    88.5    3. This notice may not be removed or altered from any source distribution.
    88.6  */
    88.7 +#include "SDL_config.h"
    88.8  
    88.9 -
   88.10 +#if SDL_VIDEO_DRIVER_BWINDOW
   88.11  
   88.12  
   88.13  #ifdef __cplusplus
   88.14 @@ -168,3 +169,5 @@
   88.15  #ifdef __cplusplus
   88.16  }
   88.17  #endif
   88.18 +
   88.19 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    89.1 --- a/src/video/bwindow/SDL_bwindow.cc	Mon Oct 31 03:06:32 2011 -0400
    89.2 +++ b/src/video/bwindow/SDL_bwindow.cc	Mon Oct 31 05:56:58 2011 -0400
    89.3 @@ -19,6 +19,8 @@
    89.4    3. This notice may not be removed or altered from any source distribution.
    89.5  */
    89.6  #include "SDL_config.h"
    89.7 +
    89.8 +#if SDL_VIDEO_DRIVER_BWINDOW
    89.9  #include "../SDL_sysvideo.h"
   89.10  
   89.11  #include "SDL_BWin.h"
   89.12 @@ -210,3 +212,4 @@
   89.13  }
   89.14  #endif
   89.15  
   89.16 +#endif /* SDL_VIDEO_DRIVER_BWINDOW */
    90.1 --- a/src/video/cocoa/SDL_cocoaclipboard.m	Mon Oct 31 03:06:32 2011 -0400
    90.2 +++ b/src/video/cocoa/SDL_cocoaclipboard.m	Mon Oct 31 05:56:58 2011 -0400
    90.3 @@ -20,6 +20,8 @@
    90.4  */
    90.5  #include "SDL_config.h"
    90.6  
    90.7 +#if SDL_VIDEO_DRIVER_COCOA
    90.8 +
    90.9  #include "SDL_cocoavideo.h"
   90.10  #include "../../events/SDL_clipboardevents_c.h"
   90.11  
   90.12 @@ -124,4 +126,6 @@
   90.13      [pool release];
   90.14  }
   90.15  
   90.16 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   90.17 +
   90.18  /* vi: set ts=4 sw=4 expandtab: */
    91.1 --- a/src/video/cocoa/SDL_cocoaevents.m	Mon Oct 31 03:06:32 2011 -0400
    91.2 +++ b/src/video/cocoa/SDL_cocoaevents.m	Mon Oct 31 05:56:58 2011 -0400
    91.3 @@ -19,6 +19,8 @@
    91.4    3. This notice may not be removed or altered from any source distribution.
    91.5  */
    91.6  #include "SDL_config.h"
    91.7 +
    91.8 +#if SDL_VIDEO_DRIVER_COCOA
    91.9  #include "SDL_timer.h"
   91.10  
   91.11  #include "SDL_cocoavideo.h"
   91.12 @@ -220,4 +222,6 @@
   91.13      [pool release];
   91.14  }
   91.15  
   91.16 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   91.17 +
   91.18  /* vi: set ts=4 sw=4 expandtab: */
    92.1 --- a/src/video/cocoa/SDL_cocoakeyboard.m	Mon Oct 31 03:06:32 2011 -0400
    92.2 +++ b/src/video/cocoa/SDL_cocoakeyboard.m	Mon Oct 31 05:56:58 2011 -0400
    92.3 @@ -20,6 +20,8 @@
    92.4  */
    92.5  #include "SDL_config.h"
    92.6  
    92.7 +#if SDL_VIDEO_DRIVER_COCOA
    92.8 +
    92.9  #include "SDL_cocoavideo.h"
   92.10  
   92.11  #include "../../events/SDL_keyboard_c.h"
   92.12 @@ -28,7 +30,7 @@
   92.13  #include <Carbon/Carbon.h>
   92.14  
   92.15  //#define DEBUG_IME NSLog
   92.16 -#define DEBUG_IME (void)
   92.17 +#define DEBUG_IME(...)
   92.18  
   92.19  #ifndef NX_DEVICERCTLKEYMASK
   92.20      #define NX_DEVICELCTLKEYMASK    0x00000001
   92.21 @@ -733,4 +735,6 @@
   92.22  {
   92.23  }
   92.24  
   92.25 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   92.26 +
   92.27  /* vi: set ts=4 sw=4 expandtab: */
    93.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Mon Oct 31 03:06:32 2011 -0400
    93.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Mon Oct 31 05:56:58 2011 -0400
    93.3 @@ -20,6 +20,8 @@
    93.4  */
    93.5  #include "SDL_config.h"
    93.6  
    93.7 +#if SDL_VIDEO_DRIVER_COCOA
    93.8 +
    93.9  #include "SDL_cocoavideo.h"
   93.10  
   93.11  /* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
   93.12 @@ -113,7 +115,6 @@
   93.13  GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
   93.14  {
   93.15      SDL_DisplayModeData *data;
   93.16 -    CFNumberRef number;
   93.17      long width, height, bpp, refreshRate;
   93.18  
   93.19      data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
   93.20 @@ -146,6 +147,7 @@
   93.21  
   93.22      #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
   93.23      if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
   93.24 +        CFNumberRef number;
   93.25          CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
   93.26          number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
   93.27          CFNumberGetValue(number, kCFNumberLongType, &width);
   93.28 @@ -448,4 +450,6 @@
   93.29      ShowMenuBar();
   93.30  }
   93.31  
   93.32 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   93.33 +
   93.34  /* vi: set ts=4 sw=4 expandtab: */
    94.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Mon Oct 31 03:06:32 2011 -0400
    94.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Mon Oct 31 05:56:58 2011 -0400
    94.3 @@ -20,6 +20,8 @@
    94.4  */
    94.5  #include "SDL_config.h"
    94.6  
    94.7 +#if SDL_VIDEO_DRIVER_COCOA
    94.8 +
    94.9  #include "SDL_events.h"
   94.10  #include "SDL_cocoavideo.h"
   94.11  
   94.12 @@ -147,21 +149,6 @@
   94.13      SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());
   94.14  }
   94.15  
   94.16 -static int
   94.17 -ConvertMouseButtonToSDL(int button)
   94.18 -{
   94.19 -    switch (button)
   94.20 -    {
   94.21 -        case 0:
   94.22 -            return(SDL_BUTTON_LEFT);   /* 1 */
   94.23 -        case 1:
   94.24 -            return(SDL_BUTTON_RIGHT);  /* 3 */
   94.25 -        case 2:
   94.26 -            return(SDL_BUTTON_MIDDLE); /* 2 */
   94.27 -    }
   94.28 -    return button+1;
   94.29 -}
   94.30 -
   94.31  void
   94.32  Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
   94.33  {
   94.34 @@ -202,4 +189,6 @@
   94.35  {
   94.36  }
   94.37  
   94.38 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   94.39 +
   94.40  /* vi: set ts=4 sw=4 expandtab: */
    95.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Mon Oct 31 03:06:32 2011 -0400
    95.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Mon Oct 31 05:56:58 2011 -0400
    95.3 @@ -20,11 +20,11 @@
    95.4  */
    95.5  #include "SDL_config.h"
    95.6  
    95.7 -#include "SDL_cocoavideo.h"
    95.8 -
    95.9  /* NSOpenGL implementation of SDL OpenGL support */
   95.10  
   95.11  #if SDL_VIDEO_OPENGL_CGL
   95.12 +#include "SDL_cocoavideo.h"
   95.13 +
   95.14  #include <OpenGL/CGLTypes.h>
   95.15  #include <OpenGL/OpenGL.h>
   95.16  #include <OpenGL/CGLRenderers.h>
    96.1 --- a/src/video/cocoa/SDL_cocoashape.m	Mon Oct 31 03:06:32 2011 -0400
    96.2 +++ b/src/video/cocoa/SDL_cocoashape.m	Mon Oct 31 05:56:58 2011 -0400
    96.3 @@ -19,6 +19,10 @@
    96.4    3. This notice may not be removed or altered from any source distribution.
    96.5  */
    96.6  
    96.7 +#include "SDL_config.h"
    96.8 +
    96.9 +#if SDL_VIDEO_DRIVER_COCOA
   96.10 +
   96.11  #include "SDL_cocoavideo.h"
   96.12  #include "SDL_shape.h"
   96.13  #include "SDL_cocoashape.h"
   96.14 @@ -89,6 +93,8 @@
   96.15  	closure.window = shaper->window;
   96.16      SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
   96.17      [closure.path addClip];
   96.18 +
   96.19 +    return 0;
   96.20  }
   96.21  
   96.22  int
   96.23 @@ -97,3 +103,7 @@
   96.24      assert(data != NULL);
   96.25      return 0;
   96.26  }
   96.27 +
   96.28 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   96.29 +
   96.30 +/* vi: set ts=4 sw=4 expandtab: */
    97.1 --- a/src/video/cocoa/SDL_cocoavideo.m	Mon Oct 31 03:06:32 2011 -0400
    97.2 +++ b/src/video/cocoa/SDL_cocoavideo.m	Mon Oct 31 05:56:58 2011 -0400
    97.3 @@ -20,6 +20,8 @@
    97.4  */
    97.5  #include "SDL_config.h"
    97.6  
    97.7 +#if SDL_VIDEO_DRIVER_COCOA
    97.8 +
    97.9  #include "SDL.h"
   97.10  #include "SDL_endian.h"
   97.11  #include "SDL_cocoavideo.h"
   97.12 @@ -259,4 +261,6 @@
   97.13      return (SDL_assert_state) (clicked - NSAlertFirstButtonReturn);
   97.14  }
   97.15  
   97.16 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   97.17 +
   97.18  /* vim: set ts=4 sw=4 expandtab: */
    98.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon Oct 31 03:06:32 2011 -0400
    98.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Oct 31 05:56:58 2011 -0400
    98.3 @@ -20,6 +20,8 @@
    98.4  */
    98.5  #include "SDL_config.h"
    98.6  
    98.7 +#if SDL_VIDEO_DRIVER_COCOA
    98.8 +
    98.9  #include "SDL_syswm.h"
   98.10  #include "SDL_timer.h"  /* For SDL_GetTicks() */
   98.11  #include "../SDL_sysvideo.h"
   98.12 @@ -277,8 +279,6 @@
   98.13  
   98.14  - (void)mouseEntered:(NSEvent *)theEvent
   98.15  {
   98.16 -    SDL_Mouse *mouse = SDL_GetMouse();
   98.17 -
   98.18      SDL_SetMouseFocus(_data->window);
   98.19  
   98.20      SDL_SetCursor(NULL);
   98.21 @@ -991,4 +991,6 @@
   98.22      }
   98.23  }
   98.24  
   98.25 +#endif /* SDL_VIDEO_DRIVER_COCOA */
   98.26 +
   98.27  /* vi: set ts=4 sw=4 expandtab: */
    99.1 --- a/src/video/directfb/SDL_DirectFB_WM.c	Mon Oct 31 03:06:32 2011 -0400
    99.2 +++ b/src/video/directfb/SDL_DirectFB_WM.c	Mon Oct 31 05:56:58 2011 -0400
    99.3 @@ -18,6 +18,9 @@
    99.4       misrepresented as being the original software.
    99.5    3. This notice may not be removed or altered from any source distribution.
    99.6  */
    99.7 +#include "SDL_config.h"
    99.8 +
    99.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
   99.10  
   99.11  #include "SDL_DirectFB_video.h"
   99.12  #include "SDL_DirectFB_window.h"
   99.13 @@ -407,3 +410,4 @@
   99.14      return 0;
   99.15  }
   99.16  
   99.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   100.1 --- a/src/video/directfb/SDL_DirectFB_dyn.c	Mon Oct 31 03:06:32 2011 -0400
   100.2 +++ b/src/video/directfb/SDL_DirectFB_dyn.c	Mon Oct 31 05:56:58 2011 -0400
   100.3 @@ -18,8 +18,9 @@
   100.4       misrepresented as being the original software.
   100.5    3. This notice may not be removed or altered from any source distribution.
   100.6  */
   100.7 +#include "SDL_config.h"
   100.8  
   100.9 -#include "SDL_config.h"
  100.10 +#if SDL_VIDEO_DRIVER_DIRECTFB
  100.11  
  100.12  #include "SDL_DirectFB_video.h"
  100.13  #include "SDL_DirectFB_dyn.h"
  100.14 @@ -112,3 +113,5 @@
  100.15  {
  100.16  }
  100.17  #endif
  100.18 +
  100.19 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   101.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Mon Oct 31 03:06:32 2011 -0400
   101.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Mon Oct 31 05:56:58 2011 -0400
   101.3 @@ -18,6 +18,9 @@
   101.4       misrepresented as being the original software.
   101.5    3. This notice may not be removed or altered from any source distribution.
   101.6  */
   101.7 +#include "SDL_config.h"
   101.8 +
   101.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  101.10  
  101.11  /* Handle the event stream, converting DirectFB input events into SDL events */
  101.12  
  101.13 @@ -743,3 +746,4 @@
  101.14  
  101.15  }
  101.16  
  101.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   102.1 --- a/src/video/directfb/SDL_DirectFB_modes.c	Mon Oct 31 03:06:32 2011 -0400
   102.2 +++ b/src/video/directfb/SDL_DirectFB_modes.c	Mon Oct 31 05:56:58 2011 -0400
   102.3 @@ -18,6 +18,9 @@
   102.4       misrepresented as being the original software.
   102.5    3. This notice may not be removed or altered from any source distribution.
   102.6  */
   102.7 +#include "SDL_config.h"
   102.8 +
   102.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  102.10  
  102.11  #include "SDL_DirectFB_video.h"
  102.12  #include "SDL_DirectFB_modes.h"
  102.13 @@ -406,4 +409,6 @@
  102.14      }
  102.15  }
  102.16  
  102.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
  102.18 +
  102.19  /* vi: set ts=4 sw=4 expandtab: */
   103.1 --- a/src/video/directfb/SDL_DirectFB_mouse.c	Mon Oct 31 03:06:32 2011 -0400
   103.2 +++ b/src/video/directfb/SDL_DirectFB_mouse.c	Mon Oct 31 05:56:58 2011 -0400
   103.3 @@ -18,8 +18,10 @@
   103.4       misrepresented as being the original software.
   103.5    3. This notice may not be removed or altered from any source distribution.
   103.6  */
   103.7 +#include "SDL_config.h"
   103.8  
   103.9 -#include "SDL_config.h"
  103.10 +#if SDL_VIDEO_DRIVER_DIRECTFB
  103.11 +
  103.12  #include "SDL_assert.h"
  103.13  
  103.14  #include "SDL_DirectFB_video.h"
  103.15 @@ -387,4 +389,6 @@
  103.16  
  103.17  #endif
  103.18  
  103.19 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
  103.20 +
  103.21  /* vi: set ts=4 sw=4 expandtab: */
   104.1 --- a/src/video/directfb/SDL_DirectFB_opengl.c	Mon Oct 31 03:06:32 2011 -0400
   104.2 +++ b/src/video/directfb/SDL_DirectFB_opengl.c	Mon Oct 31 05:56:58 2011 -0400
   104.3 @@ -18,6 +18,9 @@
   104.4       misrepresented as being the original software.
   104.5    3. This notice may not be removed or altered from any source distribution.
   104.6  */
   104.7 +#include "SDL_config.h"
   104.8 +
   104.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  104.10  
  104.11  #include "SDL_DirectFB_video.h"
  104.12  
  104.13 @@ -352,4 +355,6 @@
  104.14  
  104.15  #endif
  104.16  
  104.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
  104.18 +
  104.19  /* vi: set ts=4 sw=4 expandtab: */
   105.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Mon Oct 31 03:06:32 2011 -0400
   105.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Mon Oct 31 05:56:58 2011 -0400
   105.3 @@ -18,6 +18,9 @@
   105.4       misrepresented as being the original software.
   105.5    3. This notice may not be removed or altered from any source distribution.
   105.6  */
   105.7 +#include "SDL_config.h"
   105.8 +
   105.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  105.10  //#include "SDL_DirectFB_video.h"
  105.11  #include "SDL_DirectFB_window.h"
  105.12  #include "SDL_DirectFB_modes.h"
  105.13 @@ -1255,4 +1258,6 @@
  105.14  }
  105.15  #endif
  105.16  
  105.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
  105.18 +
  105.19  /* vi: set ts=4 sw=4 expandtab: */
   106.1 --- a/src/video/directfb/SDL_DirectFB_shape.c	Mon Oct 31 03:06:32 2011 -0400
   106.2 +++ b/src/video/directfb/SDL_DirectFB_shape.c	Mon Oct 31 05:56:58 2011 -0400
   106.3 @@ -18,6 +18,9 @@
   106.4       misrepresented as being the original software.
   106.5    3. This notice may not be removed or altered from any source distribution.
   106.6  */
   106.7 +#include "SDL_config.h"
   106.8 +
   106.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  106.10  
  106.11  #include "SDL_assert.h"
  106.12  #include "SDL_DirectFB_video.h"
  106.13 @@ -128,3 +131,4 @@
  106.14  	return -1;
  106.15  }
  106.16  
  106.17 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   107.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Mon Oct 31 03:06:32 2011 -0400
   107.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Mon Oct 31 05:56:58 2011 -0400
   107.3 @@ -18,6 +18,9 @@
   107.4       misrepresented as being the original software.
   107.5    3. This notice may not be removed or altered from any source distribution.
   107.6  */
   107.7 +#include "SDL_config.h"
   107.8 +
   107.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  107.10  
  107.11  #include "SDL_DirectFB_video.h"
  107.12  
  107.13 @@ -416,3 +419,5 @@
  107.14      		ri->texture_formats[j++] = pixelformat_tab[i].sdl;
  107.15      ri->num_texture_formats = j;
  107.16  }
  107.17 +
  107.18 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   108.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Mon Oct 31 03:06:32 2011 -0400
   108.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Mon Oct 31 05:56:58 2011 -0400
   108.3 @@ -18,6 +18,9 @@
   108.4       misrepresented as being the original software.
   108.5    3. This notice may not be removed or altered from any source distribution.
   108.6  */
   108.7 +#include "SDL_config.h"
   108.8 +
   108.9 +#if SDL_VIDEO_DRIVER_DIRECTFB
  108.10  
  108.11  #include "SDL_DirectFB_video.h"
  108.12  #include "SDL_DirectFB_modes.h"
  108.13 @@ -520,3 +523,5 @@
  108.14    error:
  108.15      return;
  108.16  }
  108.17 +
  108.18 +#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
   109.1 --- a/src/video/dummy/SDL_nullevents.c	Mon Oct 31 03:06:32 2011 -0400
   109.2 +++ b/src/video/dummy/SDL_nullevents.c	Mon Oct 31 05:56:58 2011 -0400
   109.3 @@ -20,6 +20,8 @@
   109.4  */
   109.5  #include "SDL_config.h"
   109.6  
   109.7 +#if SDL_VIDEO_DRIVER_DUMMY
   109.8 +
   109.9  /* Being a null driver, there's no event stream. We just define stubs for
  109.10     most of the API. */
  109.11  
  109.12 @@ -34,4 +36,6 @@
  109.13      /* do nothing. */
  109.14  }
  109.15  
  109.16 +#endif /* SDL_VIDEO_DRIVER_DUMMY */
  109.17 +
  109.18  /* vi: set ts=4 sw=4 expandtab: */
   110.1 --- a/src/video/dummy/SDL_nullframebuffer.c	Mon Oct 31 03:06:32 2011 -0400
   110.2 +++ b/src/video/dummy/SDL_nullframebuffer.c	Mon Oct 31 05:56:58 2011 -0400
   110.3 @@ -20,7 +20,10 @@
   110.4  */
   110.5  #include "SDL_config.h"
   110.6  
   110.7 +#if SDL_VIDEO_DRIVER_DUMMY
   110.8 +
   110.9  #include "../SDL_sysvideo.h"
  110.10 +#include "SDL_nullframebuffer_c.h"
  110.11  
  110.12  
  110.13  #define DUMMY_SURFACE   "_SDL_DummySurface"
  110.14 @@ -86,4 +89,6 @@
  110.15      }
  110.16  }
  110.17  
  110.18 +#endif /* SDL_VIDEO_DRIVER_DUMMY */
  110.19 +
  110.20  /* vi: set ts=4 sw=4 expandtab: */
   111.1 --- a/src/video/dummy/SDL_nullvideo.c	Mon Oct 31 03:06:32 2011 -0400
   111.2 +++ b/src/video/dummy/SDL_nullvideo.c	Mon Oct 31 05:56:58 2011 -0400
   111.3 @@ -20,6 +20,8 @@
   111.4  */
   111.5  #include "SDL_config.h"
   111.6  
   111.7 +#if SDL_VIDEO_DRIVER_DUMMY
   111.8 +
   111.9  /* Dummy SDL video driver implementation; this is just enough to make an
  111.10   *  SDL-based application THINK it's got a working video driver, for
  111.11   *  applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
  111.12 @@ -139,4 +141,6 @@
  111.13  {
  111.14  }
  111.15  
  111.16 +#endif /* SDL_VIDEO_DRIVER_DUMMY */
  111.17 +
  111.18  /* vi: set ts=4 sw=4 expandtab: */
   112.1 --- a/src/video/nds/SDL_ndsevents.c	Mon Oct 31 03:06:32 2011 -0400
   112.2 +++ b/src/video/nds/SDL_ndsevents.c	Mon Oct 31 05:56:58 2011 -0400
   112.3 @@ -20,8 +20,7 @@
   112.4  */
   112.5  #include "SDL_config.h"
   112.6  
   112.7 -/* Being a null driver, there's no event stream. We just define stubs for
   112.8 -   most of the API. */
   112.9 +#if SDL_VIDEO_DRIVER_NDS
  112.10  
  112.11  #include <stdio.h>
  112.12  #include <stdlib.h>
  112.13 @@ -50,4 +49,6 @@
  112.14      }
  112.15  }
  112.16  
  112.17 +#endif /* SDL_VIDEO_DRIVER_NDS */
  112.18 +
  112.19  /* vi: set ts=4 sw=4 expandtab: */
   113.1 --- a/src/video/nds/SDL_ndsvideo.c	Mon Oct 31 03:06:32 2011 -0400
   113.2 +++ b/src/video/nds/SDL_ndsvideo.c	Mon Oct 31 05:56:58 2011 -0400
   113.3 @@ -20,6 +20,8 @@
   113.4  */
   113.5  #include "SDL_config.h"
   113.6  
   113.7 +#if SDL_VIDEO_DRIVER_NDS
   113.8 +
   113.9  /* SDL Nintendo DS video driver implementation */
  113.10  
  113.11  #include <stdio.h>
  113.12 @@ -394,4 +396,6 @@
  113.13  	return 0;
  113.14  }
  113.15  
  113.16 +#endif /* SDL_VIDEO_DRIVER_NDS */
  113.17 +
  113.18  /* vi: set ts=4 sw=4 expandtab: */
   114.1 --- a/src/video/nds/SDL_ndswindow.c	Mon Oct 31 03:06:32 2011 -0400
   114.2 +++ b/src/video/nds/SDL_ndswindow.c	Mon Oct 31 05:56:58 2011 -0400
   114.3 @@ -20,6 +20,8 @@
   114.4  */
   114.5  #include "SDL_config.h"
   114.6  
   114.7 +#if SDL_VIDEO_DRIVER_NDS
   114.8 +
   114.9  #include "SDL_ndsvideo.h"
  114.10  
  114.11  
  114.12 @@ -30,4 +32,6 @@
  114.13      return 0;
  114.14  }
  114.15  
  114.16 +#endif /* SDL_VIDEO_DRIVER_NDS */
  114.17 +
  114.18  /* vi: set ts=4 sw=4 expandtab: */
   115.1 --- a/src/video/pandora/SDL_pandora.c	Mon Oct 31 03:06:32 2011 -0400
   115.2 +++ b/src/video/pandora/SDL_pandora.c	Mon Oct 31 05:56:58 2011 -0400
   115.3 @@ -18,9 +18,11 @@
   115.4       misrepresented as being the original software.
   115.5    3. This notice may not be removed or altered from any source distribution.
   115.6  */
   115.7 +#include "SDL_config.h"
   115.8 +
   115.9 +#if SDL_VIDEO_DRIVER_PANDORA
  115.10  
  115.11  /* SDL internals */
  115.12 -#include "SDL_config.h"
  115.13  #include "../SDL_sysvideo.h"
  115.14  #include "SDL_version.h"
  115.15  #include "SDL_syswm.h"
  115.16 @@ -863,4 +865,6 @@
  115.17      return;
  115.18  }
  115.19  
  115.20 +#endif /* SDL_VIDEO_DRIVER_PANDORA */
  115.21 +
  115.22  /* vi: set ts=4 sw=4 expandtab: */
   116.1 --- a/src/video/pandora/SDL_pandora_events.c	Mon Oct 31 03:06:32 2011 -0400
   116.2 +++ b/src/video/pandora/SDL_pandora_events.c	Mon Oct 31 05:56:58 2011 -0400
   116.3 @@ -20,6 +20,8 @@
   116.4  */
   116.5  #include "SDL_config.h"
   116.6  
   116.7 +#if SDL_VIDEO_DRIVER_PANDORA
   116.8 +
   116.9  /* Being a null driver, there's no event stream. We just define stubs for
  116.10     most of the API. */
  116.11  
  116.12 @@ -31,4 +33,6 @@
  116.13      /* Not implemented. */
  116.14  }
  116.15  
  116.16 +#endif /* SDL_VIDEO_DRIVER_PANDORA */
  116.17 +
  116.18  /* vi: set ts=4 sw=4 expandtab: */
   117.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Mon Oct 31 03:06:32 2011 -0400
   117.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Mon Oct 31 05:56:58 2011 -0400
   117.3 @@ -18,6 +18,9 @@
   117.4       misrepresented as being the original software.
   117.5    3. This notice may not be removed or altered from any source distribution.
   117.6  */
   117.7 +#include "SDL_config.h"
   117.8 +
   117.9 +#if SDL_VIDEO_DRIVER_UIKIT
  117.10  
  117.11  #import "../SDL_sysvideo.h"
  117.12  #import "SDL_assert.h"
  117.13 @@ -159,4 +162,6 @@
  117.14  
  117.15  @end
  117.16  
  117.17 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  117.18 +
  117.19  /* vi: set ts=4 sw=4 expandtab: */
   118.1 --- a/src/video/uikit/SDL_uikitevents.m	Mon Oct 31 03:06:32 2011 -0400
   118.2 +++ b/src/video/uikit/SDL_uikitevents.m	Mon Oct 31 05:56:58 2011 -0400
   118.3 @@ -20,6 +20,8 @@
   118.4  */
   118.5  #include "SDL_config.h"
   118.6  
   118.7 +#if SDL_VIDEO_DRIVER_UIKIT
   118.8 +
   118.9  #include "../../events/SDL_events_c.h"
  118.10  
  118.11  #include "SDL_uikitvideo.h"
  118.12 @@ -51,4 +53,6 @@
  118.13      }
  118.14  }
  118.15  
  118.16 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  118.17 +
  118.18  /* vi: set ts=4 sw=4 expandtab: */
   119.1 --- a/src/video/uikit/SDL_uikitopengles.m	Mon Oct 31 03:06:32 2011 -0400
   119.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Mon Oct 31 05:56:58 2011 -0400
   119.3 @@ -18,6 +18,9 @@
   119.4       misrepresented as being the original software.
   119.5    3. This notice may not be removed or altered from any source distribution.
   119.6  */
   119.7 +#include "SDL_config.h"
   119.8 +
   119.9 +#if SDL_VIDEO_DRIVER_UIKIT
  119.10  
  119.11  #include "SDL_uikitopengles.h"
  119.12  #include "SDL_uikitopenglview.h"
  119.13 @@ -27,6 +30,7 @@
  119.14  #include "SDL_sysvideo.h"
  119.15  #include "../../events/SDL_keyboard_c.h"
  119.16  #include "../../events/SDL_mouse_c.h"
  119.17 +#include "../../power/uikit/SDL_syspower.h"
  119.18  #include "SDL_loadso.h"
  119.19  #include <dlfcn.h>
  119.20  
  119.21 @@ -73,8 +77,6 @@
  119.22      return 0;
  119.23  }
  119.24  
  119.25 -extern void SDL_UIKit_UpdateBatteryMonitoring(void);
  119.26 -
  119.27  void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
  119.28  {
  119.29  #ifdef SDL_POWER_UIKIT
  119.30 @@ -101,7 +103,6 @@
  119.31  {
  119.32      SDL_uikitopenglview *view;
  119.33      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
  119.34 -    UIScreen *uiscreen = (UIScreen *) SDL_GetDisplayForWindow(window)->driverdata;
  119.35      UIWindow *uiwindow = data->uiwindow;
  119.36  
  119.37      /* construct our view, passing in SDL's OpenGL configuration data */
  119.38 @@ -150,4 +151,6 @@
  119.39      [view release];
  119.40  }
  119.41  
  119.42 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  119.43 +
  119.44  /* vi: set ts=4 sw=4 expandtab: */
   120.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Mon Oct 31 03:06:32 2011 -0400
   120.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Mon Oct 31 05:56:58 2011 -0400
   120.3 @@ -18,6 +18,9 @@
   120.4       misrepresented as being the original software.
   120.5    3. This notice may not be removed or altered from any source distribution.
   120.6  */
   120.7 +#include "SDL_config.h"
   120.8 +
   120.9 +#if SDL_VIDEO_DRIVER_UIKIT
  120.10  
  120.11  #import <QuartzCore/QuartzCore.h>
  120.12  #import <OpenGLES/EAGLDrawable.h>
  120.13 @@ -192,4 +195,6 @@
  120.14  
  120.15  @end
  120.16  
  120.17 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  120.18 +
  120.19  /* vi: set ts=4 sw=4 expandtab: */
   121.1 --- a/src/video/uikit/SDL_uikitvideo.m	Mon Oct 31 03:06:32 2011 -0400
   121.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Mon Oct 31 05:56:58 2011 -0400
   121.3 @@ -18,11 +18,12 @@
   121.4       misrepresented as being the original software.
   121.5    3. This notice may not be removed or altered from any source distribution.
   121.6  */
   121.7 +#include "SDL_config.h"
   121.8 +
   121.9 +#if SDL_VIDEO_DRIVER_UIKIT
  121.10  
  121.11  #import <UIKit/UIKit.h>
  121.12  
  121.13 -#include "SDL_config.h"
  121.14 -
  121.15  #include "SDL_video.h"
  121.16  #include "SDL_mouse.h"
  121.17  #include "../SDL_sysvideo.h"
  121.18 @@ -143,7 +144,6 @@
  121.19          return;
  121.20      }
  121.21  
  121.22 -    const NSArray *modes = [uiscreen availableModes];
  121.23      for (UIScreenMode *uimode in [uiscreen availableModes]) {
  121.24          CGSize size = [uimode size];
  121.25          mode.format = SDL_PIXELFORMAT_ABGR8888;
  121.26 @@ -274,4 +274,6 @@
  121.27      }
  121.28  }
  121.29  
  121.30 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  121.31 +
  121.32  /* vi: set ts=4 sw=4 expandtab: */
   122.1 --- a/src/video/uikit/SDL_uikitview.m	Mon Oct 31 03:06:32 2011 -0400
   122.2 +++ b/src/video/uikit/SDL_uikitview.m	Mon Oct 31 05:56:58 2011 -0400
   122.3 @@ -18,6 +18,9 @@
   122.4       misrepresented as being the original software.
   122.5    3. This notice may not be removed or altered from any source distribution.
   122.6  */
   122.7 +#include "SDL_config.h"
   122.8 +
   122.9 +#if SDL_VIDEO_DRIVER_UIKIT
  122.10  
  122.11  #import "SDL_uikitview.h"
  122.12  
  122.13 @@ -28,6 +31,7 @@
  122.14  #if SDL_IPHONE_KEYBOARD
  122.15  #import "keyinfotable.h"
  122.16  #import "SDL_uikitappdelegate.h"
  122.17 +#import "SDL_uikitkeyboard.h"
  122.18  #import "SDL_uikitwindow.h"
  122.19  #endif
  122.20  
  122.21 @@ -311,7 +315,7 @@
  122.22  /* iPhone keyboard addition functions */
  122.23  #if SDL_IPHONE_KEYBOARD
  122.24  
  122.25 -SDL_uikitview * getWindowView(SDL_Window * window)
  122.26 +static SDL_uikitview * getWindowView(SDL_Window * window)
  122.27  {
  122.28      if (window == NULL) {
  122.29          SDL_SetError("Window does not exist");
  122.30 @@ -405,4 +409,6 @@
  122.31  
  122.32  #endif /* SDL_IPHONE_KEYBOARD */
  122.33  
  122.34 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  122.35 +
  122.36  /* vi: set ts=4 sw=4 expandtab: */
   123.1 --- a/src/video/uikit/SDL_uikitviewcontroller.m	Mon Oct 31 03:06:32 2011 -0400
   123.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.m	Mon Oct 31 05:56:58 2011 -0400
   123.3 @@ -1,25 +1,27 @@
   123.4  /*
   123.5 - Simple DirectMedia Layer
   123.6 - Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
   123.7 +  Simple DirectMedia Layer
   123.8 +  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
   123.9  
  123.10 - This software is provided 'as-is', without any express or implied
  123.11 - warranty.  In no event will the authors be held liable for any damages
  123.12 - arising from the use of this software.
  123.13 +  This software is provided 'as-is', without any express or implied
  123.14 +  warranty.  In no event will the authors be held liable for any damages
  123.15 +  arising from the use of this software.
  123.16  
  123.17 - Permission is granted to anyone to use this software for any purpose,
  123.18 - including commercial applications, and to alter it and redistribute it
  123.19 - freely, subject to the following restrictions:
  123.20 +  Permission is granted to anyone to use this software for any purpose,
  123.21 +  including commercial applications, and to alter it and redistribute it
  123.22 +  freely, subject to the following restrictions:
  123.23  
  123.24 - 1. The origin of this software must not be misrepresented; you must not
  123.25 - claim that you wrote the original software. If you use this software
  123.26 - in a product, an acknowledgment in the product documentation would be
  123.27 - appreciated but is not required.
  123.28 - 2. Altered source versions must be plainly marked as such, and must not be
  123.29 - misrepresented as being the original software.
  123.30 - 3. This notice may not be removed or altered from any source distribution.
  123.31 - */
  123.32 +  1. The origin of this software must not be misrepresented; you must not
  123.33 +     claim that you wrote the original software. If you use this software
  123.34 +     in a product, an acknowledgment in the product documentation would be
  123.35 +     appreciated but is not required.
  123.36 +  2. Altered source versions must be plainly marked as such, and must not be
  123.37 +     misrepresented as being the original software.
  123.38 +  3. This notice may not be removed or altered from any source distribution.
  123.39 +*/
  123.40  #include "SDL_config.h"
  123.41  
  123.42 +#if SDL_VIDEO_DRIVER_UIKIT
  123.43 +
  123.44  #include "SDL_video.h"
  123.45  #include "SDL_assert.h"
  123.46  #include "SDL_hints.h"
  123.47 @@ -150,4 +152,6 @@
  123.48      SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
  123.49  }
  123.50  
  123.51 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  123.52 +
  123.53  @end
   124.1 --- a/src/video/uikit/SDL_uikitwindow.m	Mon Oct 31 03:06:32 2011 -0400
   124.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Mon Oct 31 05:56:58 2011 -0400
   124.3 @@ -20,6 +20,8 @@
   124.4  */
   124.5  #include "SDL_config.h"
   124.6  
   124.7 +#if SDL_VIDEO_DRIVER_UIKIT
   124.8 +
   124.9  #include "SDL_syswm.h"
  124.10  #include "SDL_video.h"
  124.11  #include "SDL_mouse.h"
  124.12 @@ -88,11 +90,11 @@
  124.13              [UIApplication sharedApplication].statusBarHidden = NO;
  124.14          }
  124.15  
  124.16 -        const UIDeviceOrientation o = [[UIDevice currentDevice] orientation];
  124.17 -        const BOOL landscape = (o == UIDeviceOrientationLandscapeLeft) ||
  124.18 -                                   (o == UIDeviceOrientationLandscapeRight);
  124.19 -        const BOOL rotate = ( ((window->w > window->h) && (!landscape)) ||
  124.20 -                              ((window->w < window->h) && (landscape)) );
  124.21 +        //const UIDeviceOrientation o = [[UIDevice currentDevice] orientation];
  124.22 +        //const BOOL landscape = (o == UIDeviceOrientationLandscapeLeft) ||
  124.23 +        //                           (o == UIDeviceOrientationLandscapeRight);
  124.24 +        //const BOOL rotate = ( ((window->w > window->h) && (!landscape)) ||
  124.25 +        //                      ((window->w < window->h) && (landscape)) );
  124.26  
  124.27          // The View Controller will handle rotating the view when the
  124.28          //  device orientation changes. This will trigger resize events, if
  124.29 @@ -215,4 +217,6 @@
  124.30      }
  124.31  }
  124.32  
  124.33 +#endif /* SDL_VIDEO_DRIVER_UIKIT */
  124.34 +
  124.35  /* vi: set ts=4 sw=4 expandtab: */
   125.1 --- a/src/video/windows/SDL_windowsclipboard.c	Mon Oct 31 03:06:32 2011 -0400
   125.2 +++ b/src/video/windows/SDL_windowsclipboard.c	Mon Oct 31 05:56:58 2011 -0400
   125.3 @@ -20,6 +20,8 @@
   125.4  */
   125.5  #include "SDL_config.h"
   125.6  
   125.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   125.8 +
   125.9  #include "SDL_windowsvideo.h"
  125.10  #include "SDL_windowswindow.h"
  125.11  #include "../../events/SDL_clipboardevents_c.h"
  125.12 @@ -163,4 +165,6 @@
  125.13      }
  125.14  }
  125.15  
  125.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  125.17 +
  125.18  /* vi: set ts=4 sw=4 expandtab: */
   126.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Oct 31 03:06:32 2011 -0400
   126.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Oct 31 05:56:58 2011 -0400
   126.3 @@ -18,8 +18,9 @@
   126.4       misrepresented as being the original software.
   126.5    3. This notice may not be removed or altered from any source distribution.
   126.6  */
   126.7 +#include "SDL_config.h"
   126.8  
   126.9 -#include "SDL_config.h"
  126.10 +#if SDL_VIDEO_DRIVER_WINDOWS
  126.11  
  126.12  #include "SDL_windowsvideo.h"
  126.13  #include "SDL_windowsshape.h"
  126.14 @@ -694,4 +695,6 @@
  126.15      }
  126.16  }
  126.17  
  126.18 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  126.19 +
  126.20  /* vi: set ts=4 sw=4 expandtab: */
   127.1 --- a/src/video/windows/SDL_windowsframebuffer.c	Mon Oct 31 03:06:32 2011 -0400
   127.2 +++ b/src/video/windows/SDL_windowsframebuffer.c	Mon Oct 31 05:56:58 2011 -0400
   127.3 @@ -20,6 +20,8 @@
   127.4  */
   127.5  #include "SDL_config.h"
   127.6  
   127.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   127.8 +
   127.9  #include "SDL_windowsvideo.h"
  127.10  
  127.11  #ifndef _WIN32_WCE
  127.12 @@ -121,4 +123,6 @@
  127.13      }
  127.14  }
  127.15  
  127.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  127.17 +
  127.18  /* vi: set ts=4 sw=4 expandtab: */
   128.1 --- a/src/video/windows/SDL_windowskeyboard.c	Mon Oct 31 03:06:32 2011 -0400
   128.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Mon Oct 31 05:56:58 2011 -0400
   128.3 @@ -20,6 +20,8 @@
   128.4  */
   128.5  #include "SDL_config.h"
   128.6  
   128.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   128.8 +
   128.9  #ifdef _WIN32_WCE
  128.10  #define SDL_DISABLE_WINDOWS_IME
  128.11  #endif
  128.12 @@ -1539,4 +1541,6 @@
  128.13  
  128.14  #endif /* SDL_DISABLE_WINDOWS_IME */
  128.15  
  128.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  128.17 +
  128.18  /* vi: set ts=4 sw=4 expandtab: */
   129.1 --- a/src/video/windows/SDL_windowsmodes.c	Mon Oct 31 03:06:32 2011 -0400
   129.2 +++ b/src/video/windows/SDL_windowsmodes.c	Mon Oct 31 05:56:58 2011 -0400
   129.3 @@ -20,6 +20,8 @@
   129.4  */
   129.5  #include "SDL_config.h"
   129.6  
   129.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   129.8 +
   129.9  #include "SDL_windowsvideo.h"
  129.10  
  129.11  /* Windows CE compatibility */
  129.12 @@ -316,4 +318,6 @@
  129.13      /* All fullscreen windows should have restored modes by now */
  129.14  }
  129.15  
  129.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  129.17 +
  129.18  /* vi: set ts=4 sw=4 expandtab: */
   130.1 --- a/src/video/windows/SDL_windowsmouse.c	Mon Oct 31 03:06:32 2011 -0400
   130.2 +++ b/src/video/windows/SDL_windowsmouse.c	Mon Oct 31 05:56:58 2011 -0400
   130.3 @@ -18,8 +18,9 @@
   130.4       misrepresented as being the original software.
   130.5    3. This notice may not be removed or altered from any source distribution.
   130.6  */
   130.7 +#include "SDL_config.h"
   130.8  
   130.9 -#include "SDL_config.h"
  130.10 +#if SDL_VIDEO_DRIVER_WINDOWS
  130.11  
  130.12  #include "SDL_assert.h"
  130.13  #include "SDL_windowsvideo.h"
  130.14 @@ -162,4 +163,6 @@
  130.15  {
  130.16  }
  130.17  
  130.18 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  130.19 +
  130.20  /* vi: set ts=4 sw=4 expandtab: */
   131.1 --- a/src/video/windows/SDL_windowsopengl.c	Mon Oct 31 03:06:32 2011 -0400
   131.2 +++ b/src/video/windows/SDL_windowsopengl.c	Mon Oct 31 05:56:58 2011 -0400
   131.3 @@ -20,6 +20,8 @@
   131.4  */
   131.5  #include "SDL_config.h"
   131.6  
   131.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   131.8 +
   131.9  #include "SDL_windowsvideo.h"
  131.10  
  131.11  /* WGL implementation of SDL OpenGL support */
  131.12 @@ -605,4 +607,6 @@
  131.13  
  131.14  #endif /* SDL_VIDEO_OPENGL_WGL */
  131.15  
  131.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  131.17 +
  131.18  /* vi: set ts=4 sw=4 expandtab: */
   132.1 --- a/src/video/windows/SDL_windowsshape.c	Mon Oct 31 03:06:32 2011 -0400
   132.2 +++ b/src/video/windows/SDL_windowsshape.c	Mon Oct 31 05:56:58 2011 -0400
   132.3 @@ -18,8 +18,10 @@
   132.4       misrepresented as being the original software.
   132.5    3. This notice may not be removed or altered from any source distribution.
   132.6  */
   132.7 +#include "SDL_config.h"
   132.8  
   132.9 -#include <stdio.h>
  132.10 +#if SDL_VIDEO_DRIVER_WINDOWS
  132.11 +
  132.12  #include "SDL_assert.h"
  132.13  #include "SDL_windowsshape.h"
  132.14  #include "SDL_windowsvideo.h"
  132.15 @@ -101,3 +103,5 @@
  132.16      
  132.17      return 0;
  132.18  }
  132.19 +
  132.20 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
   133.1 --- a/src/video/windows/SDL_windowsvideo.c	Mon Oct 31 03:06:32 2011 -0400
   133.2 +++ b/src/video/windows/SDL_windowsvideo.c	Mon Oct 31 05:56:58 2011 -0400
   133.3 @@ -20,6 +20,8 @@
   133.4  */
   133.5  #include "SDL_config.h"
   133.6  
   133.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   133.8 +
   133.9  #include "SDL_main.h"
  133.10  #include "SDL_video.h"
  133.11  #include "SDL_mouse.h"
  133.12 @@ -186,4 +188,6 @@
  133.13      WIN_QuitMouse(_this);
  133.14  }
  133.15  
  133.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  133.17 +
  133.18  /* vim: set ts=4 sw=4 expandtab: */
   134.1 --- a/src/video/windows/SDL_windowswindow.c	Mon Oct 31 03:06:32 2011 -0400
   134.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Oct 31 05:56:58 2011 -0400
   134.3 @@ -20,6 +20,8 @@
   134.4  */
   134.5  #include "SDL_config.h"
   134.6  
   134.7 +#if SDL_VIDEO_DRIVER_WINDOWS
   134.8 +
   134.9  #include "../SDL_sysvideo.h"
  134.10  #include "../SDL_pixels_c.h"
  134.11  #include "../../events/SDL_keyboard_c.h"
  134.12 @@ -746,4 +748,6 @@
  134.13      }
  134.14  }
  134.15  
  134.16 +#endif /* SDL_VIDEO_DRIVER_WINDOWS */
  134.17 +
  134.18  /* vi: set ts=4 sw=4 expandtab: */
   135.1 --- a/src/video/x11/SDL_x11opengl.c	Mon Oct 31 03:06:32 2011 -0400
   135.2 +++ b/src/video/x11/SDL_x11opengl.c	Mon Oct 31 05:56:58 2011 -0400
   135.3 @@ -19,6 +19,9 @@
   135.4    3. This notice may not be removed or altered from any source distribution.
   135.5  */
   135.6  #include "SDL_config.h"
   135.7 +
   135.8 +#if SDL_VIDEO_DRIVER_X11
   135.9 +
  135.10  #include "SDL_x11video.h"
  135.11  #include "SDL_assert.h"
  135.12  
  135.13 @@ -610,4 +613,6 @@
  135.14  
  135.15  #endif /* SDL_VIDEO_OPENGL_GLX */
  135.16  
  135.17 +#endif /* SDL_VIDEO_DRIVER_X11 */
  135.18 +
  135.19  /* vi: set ts=4 sw=4 expandtab: */
   136.1 --- a/src/video/x11/SDL_x11opengles.c	Mon Oct 31 03:06:32 2011 -0400
   136.2 +++ b/src/video/x11/SDL_x11opengles.c	Mon Oct 31 05:56:58 2011 -0400
   136.3 @@ -20,7 +20,7 @@
   136.4  */
   136.5  #include "SDL_config.h"
   136.6  
   136.7 -#if SDL_VIDEO_OPENGL_ES
   136.8 +#if SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_ES
   136.9  
  136.10  #include "SDL_x11video.h"
  136.11  #include "SDL_x11opengles.h"
  136.12 @@ -360,6 +360,6 @@
  136.13  
  136.14  }
  136.15  
  136.16 -#endif /* SDL_VIDEO_OPENGL_ES */
  136.17 +#endif /* SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_ES */
  136.18  
  136.19  /* vi: set ts=4 sw=4 expandtab: */
   137.1 --- a/src/video/x11/imKStoUCS.c	Mon Oct 31 03:06:32 2011 -0400
   137.2 +++ b/src/video/x11/imKStoUCS.c	Mon Oct 31 05:56:58 2011 -0400
   137.3 @@ -22,6 +22,9 @@
   137.4  ings in this Software without prior written authorization from the XFree86
   137.5  Project.
   137.6  */
   137.7 +#include "SDL_config.h"
   137.8 +
   137.9 +#if SDL_VIDEO_DRIVER_X11
  137.10  
  137.11  /* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.4 2003/04/29 11:29:18 pascal Exp $ */
  137.12  
  137.13 @@ -343,3 +346,5 @@
  137.14      else
  137.15          return 0;
  137.16  }
  137.17 +
  137.18 +#endif /* SDL_VIDEO_DRIVER_X11 */