From 3db061e6700deea416c2d4822329a806aa830905 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 26 Jun 2011 15:40:15 -0700 Subject: Combine the two pa_load definitions into one --- Alc/portaudio.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'Alc/portaudio.c') diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 08bc0065..b52bd811 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -56,6 +56,7 @@ MAKE_FUNC(Pa_GetStreamInfo); #define Pa_CloseStream pPa_CloseStream #define Pa_GetDefaultOutputDevice pPa_GetDefaultOutputDevice #define Pa_GetStreamInfo pPa_GetStreamInfo +#endif void *pa_load(void) { @@ -63,6 +64,7 @@ void *pa_load(void) { PaError err; +#ifdef HAVE_DYNLOAD #ifdef _WIN32 # define PALIB "portaudio.dll" #elif defined(__APPLE__) && defined(__MACH__) @@ -96,6 +98,9 @@ void *pa_load(void) LOAD_FUNC(Pa_GetDefaultOutputDevice); LOAD_FUNC(Pa_GetStreamInfo); #undef LOAD_FUNC +#else + pa_handle = (void*)0xDEADBEEF; +#endif if((err=Pa_Initialize()) != paNoError) { @@ -107,21 +112,6 @@ void *pa_load(void) } return pa_handle; } -#else -void *pa_load(void) -{ - if(!pa_handle) - { - pa_handle = (void*)0xDEADBEEF; - if((err=Pa_Initialize()) != paNoError) - { - AL_PRINT("Pa_Initialize() returned an error: %s\n", Pa_GetErrorText(err)); - pa_handle = NULL; - } - } - return pa_handle; -} -#endif typedef struct { -- cgit v1.2.3