Warn when resampled HRIR delays get clamped
[openal-soft.git] / common / alexcpt.cpp
blob5055e34fac180ea50613f150c2015bd9a40e50b5
2 #include "config.h"
4 #include "alexcpt.h"
6 #include <cstdio>
7 #include <cstdarg>
9 #include "opthelpers.h"
12 namespace al {
14 backend_exception::backend_exception(ALCenum code, const char *msg, ...) : mErrorCode{code}
16 va_list args, args2;
17 va_start(args, msg);
18 va_copy(args2, args);
19 int msglen{std::vsnprintf(nullptr, 0, msg, args)};
20 if LIKELY(msglen > 0)
22 mMessage.resize(static_cast<size_t>(msglen)+1);
23 std::vsnprintf(&mMessage[0], mMessage.length(), msg, args2);
24 mMessage.pop_back();
26 va_end(args2);
27 va_end(args);
30 } // namespace al