From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 36DA83856247; Tue, 10 May 2022 18:28:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36DA83856247 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: baea5737f6473e6c3f017cf47705a50d5f4ac0ec X-Git-Newrev: ae356f57c542bcc2ba665035915abae16ba221ae Message-Id: <20220510182853.36DA83856247@sourceware.org> Date: Tue, 10 May 2022 18:28:53 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 18:28:53 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ae356f57c542bcc2ba665035915abae16ba221ae commit ae356f57c542bcc2ba665035915abae16ba221ae 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 329b7492e9..01da126c71 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -710,4 +710,11 @@ _Static_assert (0, "Compat long double requires redirection on this platform"); # 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 17f6a1446f..e504c6b4bf 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