From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by sourceware.org (Postfix) with ESMTPS id E9350386075B; Thu, 20 Oct 2022 12:56:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9350386075B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4MtSKC3CFNz9sQH; Thu, 20 Oct 2022 14:56:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1666270591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=on52WHKmxGaE20a6ndfm4H/Kk6Uhw7HmIENVr2rSD6w=; b=nhEcEJknUfdFQFBdP3ORKUaA0MN32OKZJkZthfOjVdhBpjZyke+XDX9c2zLy98Dce0SyDR B+mTPU8BdDm0oUhqhl83PjGqf1yz/KLJKuKrtD/4oGRi0yzJQGlmnZvqgVzqNyzWDl1Foo HeBqeXdaEksra/w4eoe4Qv7upYcJ236Fy5SF7C5aJHCnRhEDidWz7bU2KDZ8CTkRSKMXKA GmLVigHpnAxWKdaJ7vH+hgaxvTHO1HrcIIADoq3ubB4tAm8z/hMVUNQiINOS1ikj5qPPkr lFQOym3NNakb4l/W3/7rtDpItJ1Lah+Xllqh9tFRc6S292om7anRZgkHR341RQ== From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, =?UTF-8?q?Arsen=20Arsenovi=C4=87?= Subject: [PATCH] libstdc++: Don't use gstdint.h anymore Date: Thu, 20 Oct 2022 14:56:16 +0200 Message-Id: <20221020125615.2198195-1-arsen@aarsen.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,KAM_SHORT,RCVD_IN_DNSWL_LOW,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 List-Id: libstdc++-v3/ChangeLog: * configure.ac: Stop generating gstdint.h. * src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h. --- Tested on x86_64-pc-linux-gnu. libstdc++-v3/configure.ac | 6 ------ libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 81d914b434a..c5ec976c026 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) -if test "$is_hosted" = yes; then -# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to -# use instead of . -GCC_HEADER_STDINT(include/gstdint.h) -fi - GLIBCXX_ENABLE_SYMVERS([yes]) AC_SUBST(libtool_VERSION) diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc index 5a0c5459088..2065eb517db 100644 --- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc +++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc @@ -22,10 +22,11 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -#include "gstdint.h" #include #include +using guintptr_t = __UINTPTR_TYPE__; + // XXX GLIBCXX_ABI Deprecated // gcc-4.7.0 @@ -119,13 +120,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_CONST __atomic_flag_base* __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW { - uintptr_t __u = reinterpret_cast(__z); + guintptr_t __u = reinterpret_cast(__z); __u += (__u >> 2) + (__u << 4); __u += (__u >> 7) + (__u << 5); __u += (__u >> 17) + (__u << 13); - if (sizeof(uintptr_t) > 4) + if (sizeof(guintptr_t) > 4) __u += (__u >> 31); - __u &= ~((~uintptr_t(0)) << LOGSIZE); + __u &= ~((~guintptr_t(0)) << LOGSIZE); return flag_table + __u; } -- 2.38.1