From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 878603861904; Thu, 28 Sep 2023 17:56:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 878603861904 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695923813; bh=KnzEXJlwu9i6QqbaVGUYie35W+plOxL2GpiHueev5VM=; h=From:To:Subject:Date:From; b=WEAeDo24V9ts6SekGUGK18tVt8McZZ2eC95u0GG5YKejrwhrcPfiVsceV+w+jyIE/ E9fPmMXS7DgBRfk1eEspnyboMQJ2I4STIPPcbjPgcQKYwx1Yv2CdwAsODHL7ypgCYW H2s0fyQBfXOJGUmO3rqhlgVKIqV9WAFAI3psZkG4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] x86: Use bool for C++ on x86.h X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: cb40ee75995a53b234b3e5c613d4f8a6db002e0b X-Git-Newrev: b1748afed7851f1206c61fb1c3a862d1a351692b Message-Id: <20230928175653.878603861904@sourceware.org> Date: Thu, 28 Sep 2023 17:56:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b1748afed7851f1206c61fb1c3a862d1a351692b commit b1748afed7851f1206c61fb1c3a862d1a351692b Author: Adhemerval Zanella Date: Thu Mar 31 10:40:02 2022 -0300 x86: Use bool for C++ on x86.h Not all compilers define C99 _Bool type on C++ mode. Diff: --- misc/sys/cdefs.h | 7 +++++++ sysdeps/x86/sys/platform/x86.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index ec8102845b..807615c570 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -727,4 +727,11 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf # define __attribute_noclone__ /* Ignore. */ #endif +/* Not all compiles support _Bool type in C++. */ +#ifdef __cplusplus +# define __BOOLEAN bool +#else +# define __BOOLEAN _Bool +#endif + #endif /* sys/cdefs.h */ diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h index 1ea2c5fc0b..88bced7d8d 100644 --- a/sysdeps/x86/sys/platform/x86.h +++ b/sysdeps/x86/sys/platform/x86.h @@ -29,7 +29,7 @@ __BEGIN_DECLS extern const struct cpuid_feature *__x86_get_cpuid_feature_leaf (unsigned int) __attribute__ ((pure)); -static __inline__ _Bool +static __inline__ __BOOLEAN x86_cpu_present (unsigned int __index) { const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf @@ -42,7 +42,7 @@ x86_cpu_present (unsigned int __index) return __ptr->cpuid_array[__reg] & (1 << __bit); } -static __inline__ _Bool +static __inline__ __BOOLEAN x86_cpu_active (unsigned int __index) { const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf