From 093718899f44cc2523b1096b7ad2363114f63492 Mon Sep 17 00:00:00 2001 From: Travis Lange Date: Tue, 4 Jun 2024 16:16:53 -0400 Subject: [PATCH] Fixed use of undeclared identifier '__cpuidex' error on mingw --- thirdparty/embree/common/sys/sysinfo.cpp | 2 +- thirdparty/embree/patches/mingw-no-cpuidex.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 thirdparty/embree/patches/mingw-no-cpuidex.patch diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp index d01eab3c9d9..4ecab052659 100644 --- a/thirdparty/embree/common/sys/sysinfo.cpp +++ b/thirdparty/embree/common/sys/sysinfo.cpp @@ -295,7 +295,7 @@ namespace embree if (nIds >= 1) __cpuid (cpuid_leaf_1,0x00000001); #if _WIN32 #if _MSC_VER && (_MSC_FULL_VER < 160040219) -#else +#elif defined(_MSC_VER) if (nIds >= 7) __cpuidex(cpuid_leaf_7,0x00000007,0); #endif #else diff --git a/thirdparty/embree/patches/mingw-no-cpuidex.patch b/thirdparty/embree/patches/mingw-no-cpuidex.patch new file mode 100644 index 00000000000..5480334cebf --- /dev/null +++ b/thirdparty/embree/patches/mingw-no-cpuidex.patch @@ -0,0 +1,13 @@ +diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp +index d01eab3c9d..4ecab05265 100644 +--- a/thirdparty/embree/common/sys/sysinfo.cpp ++++ b/thirdparty/embree/common/sys/sysinfo.cpp +@@ -295,7 +295,7 @@ namespace embree + if (nIds >= 1) __cpuid (cpuid_leaf_1,0x00000001); + #if _WIN32 + #if _MSC_VER && (_MSC_FULL_VER < 160040219) +-#else ++#elif defined(_MSC_VER) + if (nIds >= 7) __cpuidex(cpuid_leaf_7,0x00000007,0); + #endif + #else