Fix Linux build

This commit is contained in:
Wojtek Figat
2021-11-10 19:58:47 +01:00
parent 1f09c19c8d
commit dd85cb1676

View File

@@ -2016,6 +2016,7 @@ bool LinuxPlatform::Init()
ASSERT(UnixCpu.CacheLineSize && Math::IsPowerOfTwo(UnixCpu.CacheLineSize)); ASSERT(UnixCpu.CacheLineSize && Math::IsPowerOfTwo(UnixCpu.CacheLineSize));
// Get user name string // Get user name string
char buffer[UNIX_APP_BUFF_SIZE];
getlogin_r(buffer, UNIX_APP_BUFF_SIZE); getlogin_r(buffer, UNIX_APP_BUFF_SIZE);
OnPlatformUserAdd(New<User>(String(buffer)); OnPlatformUserAdd(New<User>(String(buffer));
@@ -2043,8 +2044,6 @@ bool LinuxPlatform::Init()
DeviceId.D = (uint32)UnixCpu.ClockSpeed * UnixCpu.LogicalProcessorCount * UnixCpu.ProcessorCoreCount * UnixCpu.CacheLineSize; DeviceId.D = (uint32)UnixCpu.ClockSpeed * UnixCpu.LogicalProcessorCount * UnixCpu.ProcessorCoreCount * UnixCpu.CacheLineSize;
} }
char buffer[UNIX_APP_BUFF_SIZE];
// Get user locale string // Get user locale string
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
const char* locale = setlocale(LC_CTYPE, NULL); const char* locale = setlocale(LC_CTYPE, NULL);