From cf97506edbbd2737bb89e5fd25fdf73dcbb42699 Mon Sep 17 00:00:00 2001 From: rlagneau Date: Wed, 5 Jun 2024 10:31:35 +0200 Subject: [PATCH] [FIX] Fix compilation error for windows --- .../core/src/tools/cpu-features/x86/cpu_x86_Windows.ipp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/core/src/tools/cpu-features/x86/cpu_x86_Windows.ipp b/modules/core/src/tools/cpu-features/x86/cpu_x86_Windows.ipp index 33e71dd0f5..05e4d702bf 100644 --- a/modules/core/src/tools/cpu-features/x86/cpu_x86_Windows.ipp +++ b/modules/core/src/tools/cpu-features/x86/cpu_x86_Windows.ipp @@ -17,6 +17,7 @@ // Dependencies #include #include +#include #include "cpu_x86.h" namespace FeatureDetector { @@ -78,7 +79,13 @@ void __cpuidex(uint CPUInfo[4], uint function_id, uint subfunction_id) #endif void cpu_x86::cpuid(uint32_t out[4], uint32_t x) { +#if defined(__MINGW32__) __cpuidex(out, x, 0U); +#else + int32_t out_as_int[4]; + __cpuidex(out_as_int, x, 0U); + memcpy(out, out_as_int, sizeof(int32_t) * 4); +#endif } __int64 xgetbv(unsigned int x) {