Use a proper literal type
[openal-soft.git] / core / except.h
blob0e28e9dfede61a9190650001103fdb7a4307c979
1 #ifndef CORE_EXCEPT_H
2 #define CORE_EXCEPT_H
4 #include <cstdarg>
5 #include <exception>
6 #include <string>
7 #include <utility>
10 namespace al {
12 class base_exception : public std::exception {
13 std::string mMessage;
15 protected:
16 base_exception() = default;
17 virtual ~base_exception();
19 void setMessage(const char *msg, std::va_list args);
21 public:
22 const char *what() const noexcept override { return mMessage.c_str(); }
25 } // namespace al
27 #define START_API_FUNC try
29 #define END_API_FUNC catch(...) { std::terminate(); }
31 #endif /* CORE_EXCEPT_H */