diff options
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 9288e658cf..6700f8fe82 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -42,6 +42,8 @@ #include <dlfcn.h> #include <libproc.h> #include <mach-o/dyld.h> +#include <os/log.h> +#include <sys/sysctl.h> _FORCE_INLINE_ String OS_OSX::get_framework_executable(const String &p_path) { // Append framework executable name, or return as is if p_path is not a framework. @@ -72,6 +74,15 @@ void OS_OSX::initialize() { initialize_core(); } +String OS_OSX::get_processor_name() const { + char buffer[256]; + size_t buffer_len = 256; + if (sysctlbyname("machdep.cpu.brand_string", &buffer, &buffer_len, NULL, 0) == 0) { + return String::utf8(buffer, buffer_len); + } + ERR_FAIL_V_MSG("", String("Couldn't get the CPU model name. Returning an empty string.")); +} + void OS_OSX::initialize_core() { OS_Unix::initialize_core(); @@ -430,7 +441,7 @@ void OS_OSX::run() { } @catch (NSException *exception) { ERR_PRINT("NSException: " + String::utf8([exception reason].UTF8String)); } - }; + } main_loop->finalize(); } |