aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-10 15:11:40 -0700
committerChris Robinson <[email protected]>2020-04-10 15:12:57 -0700
commitf7380a44d4c5c6345602db8630ae7bbd971cac1d (patch)
tree9034ad41ed0275498c7c712b9fe4cff8f5c725ee /alc/backends
parent611a0155cd4bbe588918b07a219cc830c77691c3 (diff)
Use a common base for a couple exceptions
Diffstat (limited to 'alc/backends')
-rw-r--r--alc/backends/base.h19
1 files changed, 18 insertions, 1 deletions
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 */