Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Lots of fixes importing SDL source wholesale into a new iOS project
  • Loading branch information
slouken committed Oct 31, 2011
1 parent 60e5a6f commit 43ced8f
Show file tree
Hide file tree
Showing 135 changed files with 496 additions and 1,096 deletions.
1 change: 0 additions & 1 deletion include/SDL_config.h.in
Expand Up @@ -233,7 +233,6 @@
#undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_SPROC
#undef SDL_THREAD_WINDOWS

/* Enable various timer systems */
Expand Down
4 changes: 4 additions & 0 deletions include/SDL_opengl.h
Expand Up @@ -30,6 +30,8 @@

#include "SDL_config.h"

#ifndef __IPHONEOS__

#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
Expand Down Expand Up @@ -11123,6 +11125,8 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
/* *INDENT-ON* */
#endif /* NO_SDL_GLEXT */

#endif /* !__IPHONEOS__ */

#endif /* _SDL_opengl_h */

/* vi: set ts=4 sw=4 expandtab: */
3 changes: 3 additions & 0 deletions src/SDL_error_c.h
Expand Up @@ -56,6 +56,9 @@ typedef struct SDL_error
} args[ERR_MAX_ARGS];
} SDL_error;

/* Defined in SDL_thread.c */
extern SDL_error *SDL_GetErrBuf(void);

#endif /* _SDL_error_c_h */

/* vi: set ts=4 sw=4 expandtab: */
10 changes: 7 additions & 3 deletions src/audio/alsa/SDL_alsa_audio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_ALSA

/* Allow access to a raw mixing buffer */

#include <sys/types.h>
Expand All @@ -33,7 +35,7 @@
#include "../SDL_audio_c.h"
#include "SDL_alsa_audio.h"

#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#include "SDL_loadso.h"
#endif

Expand Down Expand Up @@ -84,7 +86,7 @@ static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int);
static int (*ALSA_snd_pcm_sw_params_set_avail_min)
(snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);

#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof
#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof

Expand Down Expand Up @@ -147,7 +149,7 @@ load_alsa_syms(void)

#undef SDL_ALSA_SYM

#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC

static void
UnloadALSALibrary(void)
Expand Down Expand Up @@ -693,4 +695,6 @@ AudioBootStrap ALSA_bootstrap = {
"alsa", "ALSA PCM audio", ALSA_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_ALSA */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/android/SDL_androidaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_ANDROID

/* Output audio to Android */

#include "SDL_audio.h"
Expand Down Expand Up @@ -154,4 +156,6 @@ Android_RunAudioThread()
SDL_RunAudio(audioDevice);
}

#endif /* SDL_AUDIO_DRIVER_ANDROID */

/* vi: set ts=4 sw=4 expandtab: */
8 changes: 6 additions & 2 deletions src/audio/arts/SDL_artsaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_ARTS

/* Allow access to a raw mixing buffer */

#ifdef HAVE_SIGNAL_H
Expand All @@ -34,14 +36,14 @@
#include "../SDL_audio_c.h"
#include "SDL_artsaudio.h"

#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#include "SDL_name.h"
#include "SDL_loadso.h"
#else
#define SDL_NAME(X) X
#endif

#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC

static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
static void *arts_handle = NULL;
Expand Down Expand Up @@ -372,4 +374,6 @@ AudioBootStrap ARTS_bootstrap = {
"arts", "Analog RealTime Synthesizer", ARTS_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_ARTS */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/baudio/SDL_beaudio.cc
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_BEOSAUDIO

/* Allow access to the audio stream on BeOS */

#include <SoundPlayer.h>
Expand Down Expand Up @@ -214,4 +216,6 @@ AudioBootStrap BEOSAUDIO_bootstrap = {
"baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_BEOSAUDIO */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/bsd/SDL_bsdaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_BSD

/*
* Driver for native OpenBSD/NetBSD audio(4).
* vedge@vedge.com.ar.
Expand Down Expand Up @@ -364,4 +366,6 @@ AudioBootStrap BSD_AUDIO_bootstrap = {
"bsd", "BSD audio", BSDAUDIO_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_BSD */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/directsound/SDL_directsound.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_DSOUND

/* Allow access to a raw mixing buffer */

#include "SDL_timer.h"
Expand Down Expand Up @@ -549,4 +551,6 @@ AudioBootStrap DSOUND_bootstrap = {
"directsound", "DirectSound", DSOUND_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_DSOUND */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/disk/SDL_diskaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_DISK

/* Output raw audio data to a file. */

#if HAVE_STDIO_H
Expand Down Expand Up @@ -159,4 +161,6 @@ AudioBootStrap DISKAUD_bootstrap = {
"disk", "direct-to-disk audio", DISKAUD_Init, 1
};

#endif /* SDL_AUDIO_DRIVER_DISK */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/dsp/SDL_dspaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_OSS

/* Allow access to a raw mixing buffer */

#include <stdio.h> /* For perror() */
Expand Down Expand Up @@ -312,4 +314,6 @@ AudioBootStrap DSP_bootstrap = {
"dsp", "OSS /dev/dsp standard audio", DSP_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_OSS */

/* vi: set ts=4 sw=4 expandtab: */
8 changes: 6 additions & 2 deletions src/audio/esd/SDL_esdaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_ESD

/* Allow access to an ESD network stream mixing buffer */

#include <sys/types.h>
Expand All @@ -34,14 +36,14 @@
#include "../SDL_audio_c.h"
#include "SDL_esdaudio.h"

#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#if SDL_AUDIO_DRIVER_ESD_DYNAMIC
#include "SDL_name.h"
#include "SDL_loadso.h"
#else
#define SDL_NAME(X) X
#endif

#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#if SDL_AUDIO_DRIVER_ESD_DYNAMIC

static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
static void *esd_handle = NULL;
Expand Down Expand Up @@ -345,4 +347,6 @@ AudioBootStrap ESD_bootstrap = {
"esd", "Enlightened Sound Daemon", ESD_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_ESD */

/* vi: set ts=4 sw=4 expandtab: */
8 changes: 6 additions & 2 deletions src/audio/fusionsound/SDL_fsaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_FUSIONSOUND

/* Allow access to a raw mixing buffer */

#ifdef HAVE_SIGNAL_H
Expand All @@ -37,7 +39,7 @@

//#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so"

#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
#include "SDL_name.h"
#include "SDL_loadso.h"
#else
Expand All @@ -51,7 +53,7 @@ typedef DFBResult DirectResult;
/* Buffers to use - more than 2 gives a lot of latency */
#define FUSION_BUFFERS (2)

#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC

static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC;
static void *fs_handle = NULL;
Expand Down Expand Up @@ -345,4 +347,6 @@ AudioBootStrap FUSIONSOUND_bootstrap = {
"fusionsound", "FusionSound", SDL_FS_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */

/* vi: set ts=4 sw=4 expandtab: */
8 changes: 6 additions & 2 deletions src/audio/nas/SDL_nasaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_NAS

/* Allow access to a raw mixing buffer */

#include <signal.h>
Expand Down Expand Up @@ -50,7 +52,7 @@ static AuEventHandlerRec *(*NAS_AuRegisterEventHandler)
(AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer);


#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
#if SDL_AUDIO_DRIVER_NAS_DYNAMIC

static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
static void *nas_handle = NULL;
Expand Down Expand Up @@ -89,7 +91,7 @@ load_nas_syms(void)

#undef SDL_NAS_SYM

#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
#if SDL_AUDIO_DRIVER_NAS_DYNAMIC

static void
UnloadNASLibrary(void)
Expand Down Expand Up @@ -397,4 +399,6 @@ AudioBootStrap NAS_bootstrap = {
"nas", "Network Audio System", NAS_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_NAS */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/nds/SDL_ndsaudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_NDS

/* Output audio to NDS */

#include <nds.h>
Expand Down Expand Up @@ -122,4 +124,6 @@ AudioBootStrap NDSAUD_bootstrap = {
"nds", "SDL NDS audio driver", NDSAUD_Init, 0 /*1? */
};

#endif /* SDL_AUDIO_DRIVER_NDS */

/* vi: set ts=4 sw=4 expandtab: */
4 changes: 4 additions & 0 deletions src/audio/paudio/SDL_paudio.c
Expand Up @@ -20,6 +20,8 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_PAUDIO

/* Allow access to a raw mixing buffer */

#include <errno.h>
Expand Down Expand Up @@ -545,4 +547,6 @@ AudioBootStrap PAUDIO_bootstrap = {
"paud", "AIX Paudio", PAUDIO_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_PAUDIO */

/* vi: set ts=4 sw=4 expandtab: */
2 changes: 1 addition & 1 deletion src/audio/pulseaudio/SDL_pulseaudio.c
Expand Up @@ -106,7 +106,7 @@ static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *);
static int load_pulseaudio_syms(void);


#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
#if SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC

static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC;
static void *pulseaudio_handle = NULL;
Expand Down
4 changes: 4 additions & 0 deletions src/audio/qsa/SDL_qsa_audio.c
Expand Up @@ -21,6 +21,8 @@

#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_QSA

#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down Expand Up @@ -863,4 +865,6 @@ AudioBootStrap QSAAUDIO_bootstrap = {
"qsa", "QNX QSA Audio", QSA_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_QSA */

/* vi: set ts=4 sw=4 expandtab: */
14 changes: 9 additions & 5 deletions src/audio/sun/SDL_sunaudio.c
@@ -1,8 +1,3 @@
/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
#error this code has not been updated for SDL 1.3.
#error if no one emails icculus at icculus.org and tells him that this
#error code is needed, this audio backend will eventually be removed from SDL.

/*
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Expand All @@ -25,6 +20,13 @@
*/
#include "SDL_config.h"

#if SDL_AUDIO_DRIVER_SUNAUDIO

/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
#error this code has not been updated for SDL 1.3.
#error if no one emails icculus at icculus.org and tells him that this
#error code is needed, this audio backend will eventually be removed from SDL.

/* Allow access to a raw mixing buffer */

#include <fcntl.h>
Expand Down Expand Up @@ -450,4 +452,6 @@ snd2au(int sample)
return (mask & sample);
}

#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 43ced8f

Please sign in to comment.