aiAssert.cpp 606 B

1234567891011121314151617181920212223242526
  1. #include <iostream>
  2. #include "aiAssert.h"
  3. #ifdef _WIN32
  4. #ifndef __GNUC__
  5. # include "crtdbg.h"
  6. #endif //ndef gcc
  7. #endif
  8. // Set a breakpoint using win32, else line, file and message will be returned and progam ends with
  9. // errrocode = 1
  10. void Assimp::aiAssert (bool expression, const std::string &message, unsigned int uiLine, const std::string &file)
  11. {
  12. if (!expression)
  13. {
  14. std::cerr << "File :" << file << ", line " << uiLine << " : " << message << std::endl;
  15. #ifdef _WIN32
  16. #ifndef __GNUC__
  17. // Set breakpoint
  18. __debugbreak();
  19. #endif //ndef gcc
  20. #else
  21. exit (1);
  22. #endif
  23. }
  24. }