🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
564 B

  1. #ifndef CORE_EXCEPT_H
  2. #define CORE_EXCEPT_H
  3. #include <cstdarg>
  4. #include <exception>
  5. #include <string>
  6. #include <utility>
  7. namespace al {
  8. class base_exception : public std::exception {
  9. std::string mMessage;
  10. protected:
  11. base_exception() = default;
  12. virtual ~base_exception();
  13. void setMessage(const char *msg, std::va_list args);
  14. public:
  15. const char *what() const noexcept override { return mMessage.c_str(); }
  16. };
  17. } // namespace al
  18. #define START_API_FUNC try
  19. #define END_API_FUNC catch(...) { std::terminate(); }
  20. #endif /* CORE_EXCEPT_H */