aiAssert.cpp 877 B

12345678910111213141516171819202122232425262728293031
  1. #include "AssimpPCH.h"
  2. #include "../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. AI_WONT_RETURN void Assimp::aiAssert (const std::string &message, unsigned int uiLine, const std::string &file)
  11. {
  12. // moved expression testing out of the function and into the macro to avoid constructing
  13. // two std::string on every single ai_assert test
  14. // if (!expression)
  15. {
  16. // FIX (Aramis): changed std::cerr to std::cout that the message appears in VS' output window ...
  17. std::cout << "File :" << file << ", line " << uiLine << " : " << message << std::endl;
  18. #ifdef _WIN32
  19. #ifndef __GNUC__
  20. // Set breakpoint
  21. __debugbreak();
  22. #endif //ndef gcc
  23. #else
  24. exit (1);
  25. #endif
  26. }
  27. }