CultureInfo.cpp 447 B

1234567891011121314151617181920
  1. #include "os/c-api/il2cpp-config-platforms.h"
  2. #if IL2CPP_TINY
  3. #include "os/Locale.h"
  4. #include "os/MarshalAlloc.h"
  5. #include <cstring>
  6. extern "C"
  7. {
  8. char* STDCALL UnityPalGetCurrentLocaleName()
  9. {
  10. auto locale = il2cpp::os::Locale::GetLocale();
  11. char* allocatedLocal = (char*)il2cpp::os::MarshalAlloc::Allocate(locale.size() + 1);
  12. strcpy(allocatedLocal, locale.c_str());
  13. return allocatedLocal;
  14. }
  15. }
  16. #endif