From patchwork Tue Dec 17 18:25:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 103297 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D4B03858CD9 for ; Tue, 17 Dec 2024 18:29:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D4B03858CD9 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Vpgfy0dB X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by sourceware.org (Postfix) with ESMTPS id DC24E3858D28 for ; Tue, 17 Dec 2024 18:25:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC24E3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC24E3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734459909; cv=none; b=MQEyKmwfgO6NpL0lbokbkUzUE5YV2Ji//STCfHbrIL8OaSkmOytv2QJybwefFmA4LqkMiPqUj13ilVoSjs4nEQFtmImcvnPVOAKxgkHP1fM6TrtHwLiaWk8HMxcvzO6YZ8oiTDDJc4j9sTJSRPDfqegsiV/BICDSpzswD7p+evE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734459909; c=relaxed/simple; bh=oz0pORapGYoAZXiWDXrC23WP/KPg3j2WzAo2zPzBd64=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ALEs7vsUB1VPVPehYvmhHdB7CeH/tOB8S9AcJvffCSotyJtHbNpT1YmQLay0b+zn/eXXKfprBfCcNNjyzz1kTjIol0DrkQwUsOiYWZPWwRow5wDFTKF1uWY01a/8NXh+YvhUAMMZ++X5QDMg38cEchHBlNtHx4R+6SbfG7l9sNE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC24E3858D28 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-844df397754so185387439f.2 for ; Tue, 17 Dec 2024 10:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734459908; x=1735064708; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hJ2EeIADLitwrhxlcPDRJb4+j5QazseXYPQcryjOxkA=; b=Vpgfy0dB6lhBWz5F1JRuy5++xFGIoa3iPAlzof+nZc6i8kFewxWMddMRdEaTXRqF6c sMYVP8FCddy9U4YCi/ehbqI5nE2fXNoB8p5kX7Uxeq+S1ZIFQ/rPKrwe8g4SG032fsiK //mBed7j9+6JEFSmX8vV/4PH50OHEtSI5I8TdXlGdKaLa7CkrigcdxprNxIf3GuSzppe 70uZiYEiBbfmRD2oin0xNPbOIte5m0BvlbOViDTBCa1LNJe0KmeGaKxSe0gEDy2vGxUt VQKoRJ9ZKKt5YmuiOTlCTPYzK/SULiIwx7cy4pQYwMaTlOLSCXsmnljY7uDU+hSblfq5 s1QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734459908; x=1735064708; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hJ2EeIADLitwrhxlcPDRJb4+j5QazseXYPQcryjOxkA=; b=S2YmZWr1tV6OFvfB/Yy3S2l7Y5CMqouendiNwHNer/FKzxGaLHOPS/njEvPDM6M2xw YvnyzDsYlaAs50qwyn9y6uonP4Q3QMxVaSZCOH40vS6+ba/9/fatFpFnXdPB8B9HaGLB U/qLANojupaKVSp+8GJ2GggFoCse7FMOkPVX1YWXTPRPz6pjZJbMWsgaRqhkFdc2LL4Q 9A9pF0KmRohLwoQ2en1pxT1Fmkova8MR386T79E92bjlh8mH4e7MsLeIYZ9O9iug0ADv JWCjQzH3mAZIarB+BfgdWvlm/BB8rTtHFZvh31Qxyos6xzKAEvRZG0PoZksKIn3cmtdJ mSiA== X-Gm-Message-State: AOJu0YxYcAIKCzO1bHjKaJf2MAxPYyXYEzJ+2rx9sFxW6EWztgfzkJ32 lEwm113Brx2lKuSHP2Tlj4lTaEbJmcaOCVKNV3Pbh6Q+qSHNnbwS X-Gm-Gg: ASbGnctIJTJEO+vHmAdlVQ1gb9jOmL/E0AVbggSA75KQhJ3fjUirY+g2QTM/kroDQO3 7XF/PrIgcST2LAxpTlqKkEWfKaQ6xoFTP1KvL+9yJ1IAQM7CwZ5KYKxftRqB8Fwe8DwlqATK/IO Fw7cLSPq9NUB3YOZhL/rdLoarEMGQG99y4mRXrT6FnBYRaw/X++IanxIxJNCr1BKA7UblCwUkLl XfhLBBUGlOxlCNRm2PBKsBizLLnat9ViNCBcUTC5KS6qV/c0qqJBA0FeW6GtUApYIh+sxaCTgRc 3y5oH+vLs26+j+c4ZQzEFsMsO964ng4CilQzoYf8EWg= X-Google-Smtp-Source: AGHT+IF+czbMw2M7ynKEWpmCAkV5cca/I6GFtuQtQT1UXhPA/ZALCcmvd6ITo0XMzU+M4hQwRyOlfw== X-Received: by 2002:a05:6e02:1fc9:b0:3a7:a29b:c181 with SMTP id e9e14a558f8ab-3bdc174e846mr260885ab.13.1734459908183; Tue, 17 Dec 2024 10:25:08 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.160.9]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e5e0a3e473sm1827437173.62.2024.12.17.10.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 10:25:07 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 5BDAAC0188; Wed, 18 Dec 2024 02:25:03 +0800 (CST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: sam@gentoo.org, fweimer@redhat.com Subject: [PATCH v2] sys/platform/x86.h: Do not depend on _Bool definition in C++ mode Date: Wed, 18 Dec 2024 02:25:03 +0800 Message-ID: <20241217182503.2494146-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3019.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org 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 --- sysdeps/unix/sysv/linux/x86/bits/platform/features.h | 2 +- sysdeps/x86/bits/platform/features.h | 2 +- sysdeps/x86/sys/platform/x86.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/x86/bits/platform/features.h b/sysdeps/unix/sysv/linux/x86/bits/platform/features.h index 7704febe92..1e63743e3f 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/platform/features.h +++ b/sysdeps/unix/sysv/linux/x86/bits/platform/features.h @@ -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__ diff --git a/sysdeps/x86/bits/platform/features.h b/sysdeps/x86/bits/platform/features.h index f02489266e..676ad0000a 100644 --- a/sysdeps/x86/bits/platform/features.h +++ b/sysdeps/x86/bits/platform/features.h @@ -20,7 +20,7 @@ # error "Never include directly; use instead." #endif -static __inline__ _Bool +static __inline__ bool x86_cpu_cet_active (unsigned int __index) { return false; diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h index b8066ccc9f..1f5378031c 100644 --- a/sysdeps/x86/sys/platform/x86.h +++ b/sysdeps/x86/sys/platform/x86.h @@ -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)