aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/portaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-26 15:40:15 -0700
committerChris Robinson <[email protected]>2011-06-26 15:40:15 -0700
commit3db061e6700deea416c2d4822329a806aa830905 (patch)
tree2fcab8c03f3193dfd882f5c8aba616b1ca25a619 /Alc/portaudio.c
parentefaaf9b5f9f55f0e148a274513c12e379741b89b (diff)
Combine the two pa_load definitions into one
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r--Alc/portaudio.c20
1 files changed, 5 insertions, 15 deletions
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 {