Assert.cpp 422 B

1234567891011121314151617181920212223
  1. #include <cstdlib>
  2. #include <iostream>
  3. namespace anki {
  4. //==============================================================================
  5. void akassert(bool expr, const char* exprTxt, const char* file, int line,
  6. const char* func)
  7. {
  8. if(!expr)
  9. {
  10. std::cerr << "(" << file << ":" << line << " " <<
  11. func << ") " << "Assertion failed: " << exprTxt << std::endl;
  12. asm("int $3");
  13. abort();
  14. }
  15. }
  16. } // end namespace