aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-04-10 14:16:15 -0700
committerChris Robinson <[email protected]>2019-04-10 14:16:15 -0700
commitb4a8615ea9308035262f565071ed37987411ff21 (patch)
treebfc22144b77a8988097f3c91f9ec2b658a0f2548 /OpenAL32
parent5ad50e4f8ef52e7ce9130fa926ca1cade391e22e (diff)
Add exception protection to the listener functions
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/alListener.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/OpenAL32/alListener.cpp b/OpenAL32/alListener.cpp
index 14fc58fc..232aba33 100644
--- a/OpenAL32/alListener.cpp
+++ b/OpenAL32/alListener.cpp
@@ -28,6 +28,7 @@
#include "alError.h"
#include "alListener.h"
#include "alSource.h"
+#include "alexcpt.h"
#define DO_UPDATEPROPS() do { \
if(!context->DeferUpdates.load(std::memory_order_acquire)) \
@@ -38,6 +39,7 @@
AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -68,9 +70,10 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener float property");
}
}
-
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -101,9 +104,10 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener 3-float property");
}
}
-
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
+START_API_FUNC
{
if(values)
{
@@ -147,9 +151,11 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener float-vector property");
}
}
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint UNUSED(value))
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -161,9 +167,10 @@ AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint UNUSED(value))
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener integer property");
}
}
-
+END_API_FUNC
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3)
+START_API_FUNC
{
switch(param)
{
@@ -183,9 +190,10 @@ AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, A
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener 3-integer property");
}
}
-
+END_API_FUNC
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values)
+START_API_FUNC
{
if(values)
{
@@ -221,9 +229,11 @@ AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener integer-vector property");
}
}
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -246,9 +256,10 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener float property");
}
}
-
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -275,9 +286,10 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener 3-float property");
}
}
-
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
+START_API_FUNC
{
switch(param)
{
@@ -315,9 +327,11 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener float-vector property");
}
}
+END_API_FUNC
AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum param, ALint *value)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -331,9 +345,10 @@ AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum param, ALint *value)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener integer property");
}
}
-
+END_API_FUNC
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3)
+START_API_FUNC
{
ContextRef context{GetContextRef()};
if(UNLIKELY(!context)) return;
@@ -360,9 +375,10 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *valu
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener 3-integer property");
}
}
-
+END_API_FUNC
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint* values)
+START_API_FUNC
{
switch(param)
{
@@ -395,6 +411,7 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint* values)
alSetError(context.get(), AL_INVALID_ENUM, "Invalid listener integer-vector property");
}
}
+END_API_FUNC
void UpdateListenerProps(ALCcontext *context)