-
-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Open
Description
Tested versions
- Reproducible in: 4.5.beta7
System information
Godot v4.5.beta7 - iPhone XR - iOS 18.3.1
Issue description
Put simply, calling OS.get_processor_name
on iOS will seemingly always result in an error like so:
drivers/apple_embedded/os_apple_embedded.mm:419:get_processor_name(): Couldn't get the CPU model name. Returning an empty string. Method/function failed. Returning: ""
This seems to be due to OS_AppleEmbedded::get_processor_name
relying on the sysctl
name machdep.cpu.brand_string
, which I believe only applies to macOS, but I could be wrong.
godot/drivers/apple_embedded/os_apple_embedded.mm
Lines 413 to 420 in 52a5644
String OS_AppleEmbedded::get_processor_name() const { | |
char buffer[256]; | |
size_t buffer_len = 256; | |
if (sysctlbyname("machdep.cpu.brand_string", &buffer, &buffer_len, nullptr, 0) == 0) { | |
return String::utf8(buffer, buffer_len); | |
} | |
ERR_FAIL_V_MSG("", String("Couldn't get the CPU model name. Returning an empty string.")); | |
} |
I haven't tested this with older versions of Godot, but seeing as how this code hasn't changed in a while I have no reason to believe this is a recent regression.
Steps to reproduce
- Open the MRP project.
- Export MRP project to iOS.
- Run the project on an iOS device.
- Note the failure/error.
Minimal reproduction project (MRP)
Metadata
Metadata
Assignees
Type
Projects
Status
For team assessment