error.h 522 B

123456789101112131415161718192021222324252627
  1. #ifndef AL_ERROR_H
  2. #define AL_ERROR_H
  3. #include "AL/al.h"
  4. #include "core/except.h"
  5. namespace al {
  6. class context_error final : public al::base_exception {
  7. ALenum mErrorCode{};
  8. public:
  9. #ifdef __MINGW32__
  10. [[gnu::format(__MINGW_PRINTF_FORMAT, 3, 4)]]
  11. #else
  12. [[gnu::format(printf, 3, 4)]]
  13. #endif
  14. context_error(ALenum code, const char *msg, ...);
  15. ~context_error() final;
  16. [[nodiscard]] auto errorCode() const noexcept -> ALenum { return mErrorCode; }
  17. };
  18. } /* namespace al */
  19. #endif /* AL_ERROR_H */