Use kAudioObjectPropertyElementMaster on macOS for compatibility
[openal-soft.git] / al / eax / exception.cpp
blobe4945d88d1a41f5ddcf8b31b554f892313dfcd30
1 #include "config.h"
3 #include "exception.h"
5 #include <cassert>
6 #include <string>
9 EaxException::EaxException(std::string_view context, std::string_view message)
10 : std::runtime_error{make_message(context, message)}
13 EaxException::~EaxException() = default;
16 std::string EaxException::make_message(std::string_view context, std::string_view message)
18 auto what = std::string{};
19 if(context.empty() && message.empty())
20 return what;
22 what.reserve((!context.empty() ? context.size() + 3 : 0) + message.length() + 1);
23 if(!context.empty())
25 what += "[";
26 what += context;
27 what += "] ";
29 what += message;
31 return what;