From 45ff716eb707f46fe38cdaa809b08a94ff8c813b Mon Sep 17 00:00:00 2001 From: jared mauch Date: Tue, 21 Apr 2026 20:37:52 -0400 Subject: [PATCH] Use __asm__ for cpuid fallback on strict ISO C builds GCC -std=c23 leaves asm undeclared; __asm__ is supported in ISO mode. --- src/isadetection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isadetection.h b/src/isadetection.h index a7b5a03..1fda512 100644 --- a/src/isadetection.h +++ b/src/isadetection.h @@ -142,7 +142,7 @@ static inline void cpuid( __get_cpuid(level, eax, ebx, ecx, edx); #else uint32_t a = *eax, b, c = *ecx, d; - asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d)); + __asm__ volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d)); *eax = a; *ebx = b; *ecx = c; @@ -156,7 +156,7 @@ static inline uint64_t xgetbv(uint32_t ecx) return _xgetbv(ecx); #else uint32_t a, c = ecx, d; - asm volatile("xgetbv\n\t" : "=d"(d), "=a"(a) : "c"(c)); + __asm__ volatile("xgetbv\n\t" : "=d"(d), "=a"(a) : "c"(c)); uint64_t xcr0 = ((uint64_t)d << 32) | (uint64_t)a; return xcr0; #endif