Error.cpp 495 B

12345678910111213141516171819202122232425262728
  1. #include "il2cpp-config.h"
  2. #include "os/Error.h"
  3. #include "os/ThreadLocalValue.h"
  4. // Note: for now the implementation is not platform depentent.
  5. namespace il2cpp
  6. {
  7. namespace os
  8. {
  9. static ThreadLocalValue s_LastError;
  10. ErrorCode Error::GetLastError()
  11. {
  12. void* value = 0;
  13. s_LastError.GetValue(&value);
  14. return (ErrorCode)(int64_t)value;
  15. }
  16. void Error::SetLastError(ErrorCode code)
  17. {
  18. s_LastError.SetValue((void*)((int64_t)code));
  19. }
  20. }
  21. }