Initialize.cpp 952 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "il2cpp-config.h"
  2. #include "os/Initialize.h"
  3. #if IL2CPP_TARGET_WINDOWS
  4. #include "os/Environment.h"
  5. #include "os/WindowsRuntime.h"
  6. #include "DllMain.h"
  7. #include <crtdbg.h>
  8. void il2cpp::os::Initialize()
  9. {
  10. #ifdef _DEBUG
  11. std::string buildMachine = il2cpp::os::Environment::GetEnvironmentVariable("UNITY_THISISABUILDMACHINE");
  12. if (!buildMachine.empty())
  13. {
  14. _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
  15. _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
  16. _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
  17. _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
  18. }
  19. #endif
  20. // This is needed so we could extract exception text from bad hresults
  21. #if !RUNTIME_TINY
  22. os::WindowsRuntime::EnableErrorReporting();
  23. os::InitializeDllMain();
  24. #endif
  25. }
  26. #if !IL2CPP_TARGET_WINRT && !IL2CPP_TARGET_XBOXONE
  27. void il2cpp::os::Uninitialize()
  28. {
  29. }
  30. #endif
  31. #endif