From f7380a44d4c5c6345602db8630ae7bbd971cac1d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 10 Apr 2020 15:11:40 -0700 Subject: Use a common base for a couple exceptions --- alc/backends/base.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'alc/backends/base.h') diff --git a/alc/backends/base.h b/alc/backends/base.h index 07200e0e..db9b2296 100644 --- a/alc/backends/base.h +++ b/alc/backends/base.h @@ -8,8 +8,9 @@ #include "AL/alc.h" -#include "alcmain.h" #include "albyte.h" +#include "alcmain.h" +#include "alexcpt.h" struct ClockLatency { @@ -79,4 +80,20 @@ protected: virtual ~BackendFactory() = default; }; +namespace al { + +class backend_exception final : public base_exception { +public: + [[gnu::format(printf, 3, 4)]] + backend_exception(ALCenum code, const char *msg, ...) : base_exception{code} + { + std::va_list args; + va_start(args, msg); + setMessage(msg, args); + va_end(args); + } +}; + +} // namespace al + #endif /* ALC_BACKENDS_BASE_H */ -- cgit v1.2.3