aboutsummaryrefslogtreecommitdiffstats
path: root/router/al.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
committerSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
commit1aaf4f070011490bcece50394b9b32dfa593fd9e (patch)
tree17d68284e401a35eea3d3a574d986d446a60763a /router/al.cpp
parent6e7cee4fa9a8af03f28ca26cd89f8357390dfc90 (diff)
parent571b546f35eead77ce109f8d4dd6c3de3199d573 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'router/al.cpp')
-rw-r--r--router/al.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/router/al.cpp b/router/al.cpp
index 06c314eb..6ed8a626 100644
--- a/router/al.cpp
+++ b/router/al.cpp
@@ -7,33 +7,31 @@
#include "router.h"
-std::atomic<DriverIface*> CurrentCtxDriver{nullptr};
-
-#define DECL_THUNK1(R,n,T1) AL_API R AL_APIENTRY n(T1 a) \
+#define DECL_THUNK1(R,n,T1) AL_API R AL_APIENTRY n(T1 a) noexcept \
{ \
DriverIface *iface = GetThreadDriver(); \
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire); \
return iface->n(a); \
}
-#define DECL_THUNK2(R,n,T1,T2) AL_API R AL_APIENTRY n(T1 a, T2 b) \
+#define DECL_THUNK2(R,n,T1,T2) AL_API R AL_APIENTRY n(T1 a, T2 b) noexcept \
{ \
DriverIface *iface = GetThreadDriver(); \
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire); \
return iface->n(a, b); \
}
-#define DECL_THUNK3(R,n,T1,T2,T3) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c) \
+#define DECL_THUNK3(R,n,T1,T2,T3) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c) noexcept \
{ \
DriverIface *iface = GetThreadDriver(); \
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire); \
return iface->n(a, b, c); \
}
-#define DECL_THUNK4(R,n,T1,T2,T3,T4) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c, T4 d) \
+#define DECL_THUNK4(R,n,T1,T2,T3,T4) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c, T4 d) noexcept \
{ \
DriverIface *iface = GetThreadDriver(); \
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire); \
return iface->n(a, b, c, d); \
}
-#define DECL_THUNK5(R,n,T1,T2,T3,T4,T5) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c, T4 d, T5 e) \
+#define DECL_THUNK5(R,n,T1,T2,T3,T4,T5) AL_API R AL_APIENTRY n(T1 a, T2 b, T3 c, T4 d, T5 e) noexcept \
{ \
DriverIface *iface = GetThreadDriver(); \
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire); \
@@ -44,7 +42,7 @@ std::atomic<DriverIface*> CurrentCtxDriver{nullptr};
/* Ugly hack for some apps calling alGetError without a current context, and
* expecting it to be AL_NO_ERROR.
*/
-AL_API ALenum AL_APIENTRY alGetError(void)
+AL_API ALenum AL_APIENTRY alGetError(void) noexcept
{
DriverIface *iface = GetThreadDriver();
if(!iface) iface = CurrentCtxDriver.load(std::memory_order_acquire);