Skip to content

Commit 134e645

Browse files
authored
[clang][X86] Fix -Wundef warning in cpuid.h (#89842)
Caught by compiling a project (SerenityOS) that uses compiler-rt and not silencing warnings from system headers.
1 parent a670cda commit 134e645

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Headers/cpuid.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef __CPUID_H
1111
#define __CPUID_H
1212

13-
#if !(__x86_64__ || __i386__)
13+
#if !defined(__x86_64__) && !defined(__i386__)
1414
#error this header is for x86 only
1515
#endif
1616

@@ -256,7 +256,7 @@
256256
#define bit_AVX10_256 0x00020000
257257
#define bit_AVX10_512 0x00040000
258258

259-
#if __i386__
259+
#ifdef __i386__
260260
#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
261261
__asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
262262
: "0"(__leaf))
@@ -285,7 +285,7 @@ static __inline unsigned int __get_cpuid_max (unsigned int __leaf,
285285
unsigned int *__sig)
286286
{
287287
unsigned int __eax, __ebx, __ecx, __edx;
288-
#if __i386__
288+
#ifdef __i386__
289289
int __cpuid_supported;
290290

291291
__asm(" pushfl\n"

0 commit comments

Comments
 (0)