From eeaf0bdadc5e4c56965640a0455a653acb4b0b38 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 9 Feb 2023 20:54:46 +0100 Subject: [PATCH] Fix non-intel arch builds (cpuid.h header) --- libs/pbd/fpu.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index a0013fee57..0d4a3f9a49 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -33,12 +33,15 @@ #include #endif -#ifdef PLATFORM_WINDOWS -#include -#elif defined(__GNUC__) || defined(__clang__) -#include -#else -#error "Unsupported compiler: need __cpuid and __cpuidex for CPU detection" +/* x86 CPU - need __cpuid to query flags */ +#if (defined __x86_64__) || (defined __i386__) || (defined _M_X64) || (defined _M_IX86) +# ifdef PLATFORM_WINDOWS +# include +# elif defined(__GNUC__) || defined(__clang__) +# include +# else +# error "Unsupported compiler: need __cpuid and __cpuidex for CPU detection" +# endif #endif #include "pbd/compose.h" @@ -52,8 +55,7 @@ using namespace std; FPU* FPU::_instance (0); -#if ( (defined __x86_64__) || (defined __i386__) || (defined _M_X64) || (defined _M_IX86) ) // ARCH_X86 - +#if (defined __x86_64__) || (defined __i386__) || (defined _M_X64) || (defined _M_IX86) #ifdef PLATFORM_WINDOWS /* Use MSVC/mingw intrinsic to get CPUID */ static void cpuid(int reg[4], int cpuid_leaf)