2
0

Assert.h 584 B

1234567891011121314151617181920212223242526
  1. #ifndef ANKI_UTIL_ASSERT_H
  2. #define ANKI_UTIL_ASSERT_H
  3. #include "anki/Config.h"
  4. /// Assertion. Print an error and stop the debugger (if it runs through a
  5. /// debugger) and then abort
  6. #if !ANKI_DEBUG
  7. # define ANKI_ASSERT(x) ((void)0)
  8. # define ANKI_ASSERTS_ENABLED 0
  9. #else
  10. namespace anki {
  11. /// Its separate so we will not include iostream
  12. extern void akassert(bool expr, const char* exprTxt, const char* file,
  13. int line, const char* func);
  14. } // end namespace
  15. # define ANKI_ASSERT(x) akassert((x), #x, ANKI_FILE, __LINE__, ANKI_FUNC)
  16. # define ANKI_ASSERTS_ENABLED 1
  17. #endif
  18. #endif