Skip to content

Commit

Permalink
On Windows, check that __cpuid is the MSVC function, not a macro
Browse files Browse the repository at this point in the history
Fixes #15
  • Loading branch information
jedisct1 committed Jan 19, 2025
1 parent 9865507 commit 5b16f87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ _runtime_arm_cpu_features(CPUFeatures *const cpu_features)
static void
_cpuid(unsigned int cpu_info[4U], const unsigned int cpu_info_type)
{
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) && \
!defined(__cpuid) /* __cpuid is a function on MSVC, can be an incompatible macro elsewhere */
__cpuid((int *) cpu_info, cpu_info_type);
#elif defined(HAVE_CPUID)
cpu_info[0] = cpu_info[1] = cpu_info[2] = cpu_info[3] = 0;
Expand Down

0 comments on commit 5b16f87

Please sign in to comment.