Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Apple Silicon build #2915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/appleseed/foundation/platform/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#ifdef APPLESEED_X86
#include <cpuid.h>
#endif

// Linux.
#elif defined __linux__
Expand Down Expand Up @@ -285,6 +287,7 @@ std::uint64_t System::get_peak_process_virtual_memory_size()

namespace
{
#ifdef APPLESEED_X86
// EAX is set to the value of `index`. Results are returned in `cpuinfo`:
// cpuinfo[0] == EAX
// cpuinfo[1] == EBX
Expand All @@ -307,6 +310,7 @@ namespace
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
return (static_cast<std::uint64_t>(edx) << 32) | eax;
}
#endif

std::size_t get_system_value(const char* name)
{
Expand Down