Skip to content

Commit

Permalink
[clang][X86] Fix -Wundef warning in cpuid.h (#89842)
Browse files Browse the repository at this point in the history
Caught by compiling a project (SerenityOS) that uses compiler-rt and not
silencing warnings from system headers.
  • Loading branch information
DanShaders authored Apr 26, 2024
1 parent a670cda commit 134e645
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang/lib/Headers/cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef __CPUID_H
#define __CPUID_H

#if !(__x86_64__ || __i386__)
#if !defined(__x86_64__) && !defined(__i386__)
#error this header is for x86 only
#endif

Expand Down Expand Up @@ -256,7 +256,7 @@
#define bit_AVX10_256 0x00020000
#define bit_AVX10_512 0x00040000

#if __i386__
#ifdef __i386__
#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
__asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
: "0"(__leaf))
Expand Down Expand Up @@ -285,7 +285,7 @@ static __inline unsigned int __get_cpuid_max (unsigned int __leaf,
unsigned int *__sig)
{
unsigned int __eax, __ebx, __ecx, __edx;
#if __i386__
#ifdef __i386__
int __cpuid_supported;

__asm(" pushfl\n"
Expand Down

0 comments on commit 134e645

Please sign in to comment.