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 /common/alexcpt.cpp | |
parent | 611a0155cd4bbe588918b07a219cc830c77691c3 (diff) |
Use a common base for a couple exceptions
Diffstat (limited to 'common/alexcpt.cpp')
-rw-r--r-- | common/alexcpt.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/alexcpt.cpp b/common/alexcpt.cpp index 5055e34f..111258a0 100644 --- a/common/alexcpt.cpp +++ b/common/alexcpt.cpp @@ -11,10 +11,9 @@ namespace al { -backend_exception::backend_exception(ALCenum code, const char *msg, ...) : mErrorCode{code} +void base_exception::setMessage(const char* msg, std::va_list args) { - va_list args, args2; - va_start(args, msg); + std::va_list args2; va_copy(args2, args); int msglen{std::vsnprintf(nullptr, 0, msg, args)}; if LIKELY(msglen > 0) @@ -24,7 +23,6 @@ backend_exception::backend_exception(ALCenum code, const char *msg, ...) : mErro mMessage.pop_back(); } va_end(args2); - va_end(args); } } // namespace al |