diff options
author | Chris Robinson <[email protected]> | 2020-04-10 15:11:40 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-04-10 15:12:57 -0700 |
commit | f7380a44d4c5c6345602db8630ae7bbd971cac1d (patch) | |
tree | 9034ad41ed0275498c7c712b9fe4cff8f5c725ee /alc/backends/base.h | |
parent | 611a0155cd4bbe588918b07a219cc830c77691c3 (diff) |
Use a common base for a couple exceptions
Diffstat (limited to 'alc/backends/base.h')
-rw-r--r-- | alc/backends/base.h | 19 |
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 */ |