diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-04-29 17:00:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-29 17:00:05 +0300 |
commit | 734c8f9a7717cf1b94a53045f19d1af22031db35 (patch) | |
tree | ca57bbd778c12e84afe4b5ba594e0d02ef2a69b9 /intern/cycles/util | |
parent | 7627e0980ddc860917f0484a976956eacbcbe1ac (diff) | |
parent | 87ba01dba90b0b2ffbad2b9e07552734959814db (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_system.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 6500a59e42c..8971867b736 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -145,7 +145,7 @@ int system_cpu_num_active_group_processors() return numaAPI_GetNumCurrentNodesProcessors(); } -#if !defined(_WIN32) || defined(FREE_WINDOWS) +#if !defined(__APPLE__) && (!defined(_WIN32) || defined(FREE_WINDOWS)) static void __cpuid(int data[4], int selector) { # if defined(__x86_64__) @@ -166,7 +166,13 @@ static void __cpuid(int data[4], int selector) string system_cpu_brand_string() { -#if !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__) +#if defined(__APPLE__) + char modelname[512] = ""; + size_t bufferlen = 512; + if (sysctlbyname("machdep.cpu.brand_string", &modelname, &bufferlen, NULL, 0) == 0) { + return modelname; + } +#elif !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__) FILE *cpuinfo = fopen("/proc/cpuinfo", "r"); if (cpuinfo != nullptr) { char cpuinfo_buf[513] = ""; |