]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sys/platform/x86.h: Do not depend on _Bool definition in C++ mode
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 17 Dec 2024 18:25:03 +0000 (02:25 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 17 Dec 2024 18:32:27 +0000 (02:32 +0800)
Clang does not define _Bool for -std=c++98:

/usr/include/bits/platform/features.h:31:19: error: unknown type name '_Bool'
   31 | static __inline__ _Bool
      |                   ^

Change _Bool to bool to silence clang++ error.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/unix/sysv/linux/x86/bits/platform/features.h
sysdeps/x86/bits/platform/features.h
sysdeps/x86/sys/platform/x86.h

index 7704febe92236b5d14a52fd3a7278e33d58c39d3..1e63743e3f7a737ff0e096735125b313c23538bb 100644 (file)
@@ -28,7 +28,7 @@ enum
   x86_feature_1_shstk          = 1U << 1
 };
 
-static __inline__ _Bool
+static __inline__ bool
 x86_cpu_cet_active (unsigned int __index)
 {
 #ifdef __x86_64__
index f02489266e3c46c769eb236794021008ddf16d1d..676ad0000aa990c25a3c5eec8bb3e7c3b7e6837b 100644 (file)
@@ -20,7 +20,7 @@
 # error "Never include <bits/platform/features.h> directly; use <sys/platform/x86.h> instead."
 #endif
 
-static __inline__ _Bool
+static __inline__ bool
 x86_cpu_cet_active (unsigned int __index)
 {
   return false;
index b8066ccc9f705fcf320c6adf37ef811970c24681..1f5378031cc4e679c4d475cfb97a9d107461cfa1 100644 (file)
@@ -30,7 +30,7 @@ __BEGIN_DECLS
 extern const struct cpuid_feature *__x86_get_cpuid_feature_leaf (unsigned int)
      __attribute__ ((pure));
 
-static __inline__ _Bool
+static __inline__ bool
 x86_cpu_present (unsigned int __index)
 {
   const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf
@@ -43,7 +43,7 @@ x86_cpu_present (unsigned int __index)
   return __ptr->cpuid_array[__reg] & (1 << __bit);
 }
 
-static __inline__ _Bool
+static __inline__ bool
 x86_cpu_active (unsigned int __index)
 {
   if (__index == x86_cpu_IBT || __index == x86_cpu_SHSTK)