From e524ce99fec4e383da71b45f106d1d1224c53f51 Mon Sep 17 00:00:00 2001 From: jon-chuang Date: Fri, 14 Apr 2023 10:22:52 +0800 Subject: [PATCH] add macos headers --- examples/common.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/common.cpp b/examples/common.cpp index 49ce6e66a..1b77fef43 100644 --- a/examples/common.cpp +++ b/examples/common.cpp @@ -7,6 +7,11 @@ #include #include +#elif defined(__APPLE__) && defined(__MACH__) +#include +#include +#endif + #if defined (_WIN32) #include #include @@ -37,6 +42,7 @@ int32_t get_num_physical_cores() { } } #elif defined(__APPLE__) && defined(__MACH__) + int32_t num_physical_cores; size_t len = sizeof(num_physical_cores); int result = sysctlbyname("hw.perflevel0.physicalcpu", &num_physical_cores, &len, NULL, 0);