aboutsummaryrefslogtreecommitdiffstats
path: root/router
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-22 05:18:44 -0700
committerChris Robinson <[email protected]>2023-05-22 05:18:44 -0700
commitb5da8485c2c01ec4039e0d15d03879dbc45f6b88 (patch)
tree1d5f7d9fcac2ffce1ba577ae6968fb41a92dd276 /router
parenteca86489e422f00d96ce59a5c53fa45bdcea593e (diff)
Make the router API functions noexcept
Diffstat (limited to 'router')
-rw-r--r--router/al.cpp12
-rw-r--r--router/alc.cpp44
2 files changed, 28 insertions, 28 deletions
diff --git a/router/al.cpp b/router/al.cpp
index 06c314eb..c7e01d51 100644
--- a/router/al.cpp
+++ b/router/al.cpp
@@ -9,31 +9,31 @@
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 +44,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);
diff --git a/router/alc.cpp b/router/alc.cpp
index 3aa3382b..fe9faa45 100644
--- a/router/alc.cpp
+++ b/router/alc.cpp
@@ -394,7 +394,7 @@ static void InitCtxFuncs(DriverIface &iface)
}
-ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename)
+ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) noexcept
{
ALCdevice *device = nullptr;
ALint idx = 0;
@@ -459,7 +459,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename)
return device;
}
-ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device)
+ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device) noexcept
{
ALint idx;
@@ -475,7 +475,7 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device)
}
-ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist)
+ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist) noexcept
{
ALCcontext *context;
ALint idx;
@@ -498,7 +498,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
return context;
}
-ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context)
+ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context) noexcept
{
ALint idx = -1;
@@ -542,7 +542,7 @@ ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context)
return ALC_TRUE;
}
-ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context)
+ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context) noexcept
{
if(context)
{
@@ -553,7 +553,7 @@ ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context)
LastError.store(ALC_INVALID_CONTEXT);
}
-ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context)
+ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context) noexcept
{
if(context)
{
@@ -564,7 +564,7 @@ ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context)
LastError.store(ALC_INVALID_CONTEXT);
}
-ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context)
+ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context) noexcept
{
ALint idx;
@@ -578,14 +578,14 @@ ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context)
ContextIfaceMap.removeByKey(context);
}
-ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void)
+ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void) noexcept
{
DriverIface *iface = GetThreadDriver();
if(!iface) iface = CurrentCtxDriver.load();
return iface ? iface->alcGetCurrentContext() : nullptr;
}
-ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context)
+ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context) noexcept
{
if(context)
{
@@ -598,7 +598,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context)
}
-ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device)
+ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device) noexcept
{
if(device)
{
@@ -609,7 +609,7 @@ ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device)
return LastError.exchange(ALC_NO_ERROR);
}
-ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname)
+ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname) noexcept
{
const char *ptr;
size_t len;
@@ -641,7 +641,7 @@ ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const A
return ALC_FALSE;
}
-ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname)
+ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname) noexcept
{
if(device)
{
@@ -661,7 +661,7 @@ ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *f
return (iter != alcFunctions.cend()) ? iter->address : nullptr;
}
-ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname)
+ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname) noexcept
{
if(device)
{
@@ -681,7 +681,7 @@ ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *e
return (iter != alcEnumerations.cend()) ? iter->value : 0;
}
-ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param)
+ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param) noexcept
{
if(device)
{
@@ -817,7 +817,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum para
return nullptr;
}
-ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values)
+ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) noexcept
{
if(device)
{
@@ -872,7 +872,7 @@ ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsi
}
-ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize)
+ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) noexcept
{
ALCdevice *device = nullptr;
ALint idx = 0;
@@ -924,7 +924,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename,
return device;
}
-ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device)
+ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device) noexcept
{
ALint idx;
@@ -939,7 +939,7 @@ ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device)
return ALC_TRUE;
}
-ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device)
+ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device) noexcept
{
if(device)
{
@@ -950,7 +950,7 @@ ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device)
LastError.store(ALC_INVALID_DEVICE);
}
-ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device)
+ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) noexcept
{
if(device)
{
@@ -961,7 +961,7 @@ ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device)
LastError.store(ALC_INVALID_DEVICE);
}
-ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples)
+ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) noexcept
{
if(device)
{
@@ -973,7 +973,7 @@ ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer,
}
-ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context)
+ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context) noexcept
{
ALCenum err = ALC_INVALID_CONTEXT;
ALint idx;
@@ -1009,7 +1009,7 @@ ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context)
return ALC_FALSE;
}
-ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void)
+ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void) noexcept
{
DriverIface *iface = GetThreadDriver();
if(iface) return iface->alcGetThreadContext();