From patchwork Fri May 12 16:48:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 93283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5252169vqo; Fri, 12 May 2023 09:52:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YUY9yHaTH1YId3MUzOA4MvgRIDSpcRr521yb0SIu9XLbxrl6IqGhVn7hPMd1ju9NuI6be X-Received: by 2002:aa7:cfc8:0:b0:50d:89c9:6387 with SMTP id r8-20020aa7cfc8000000b0050d89c96387mr20426563edy.27.1683910360075; Fri, 12 May 2023 09:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683910360; cv=none; d=google.com; s=arc-20160816; b=NwMqFzL3hqdd4BCbmk7zqBhUGGQ5ZjdZN1trA2luun4I1OlDODxWmRUNyqZG5anjIb NZOnpblJexyxAdtuj5YqMsh/j3bkYDgl5qCCe7WChAkQAFq+km4C5vBH6IPK69pAZQIQ bt97HlwGGt/C5n/DGcLIzFGXXeyq/ILvzrIO2VupcL6hJsmGlbjJb2nAAbQ39Qf/eljN GXzo68Sum8ZvGeB9w8teUkQ8x4/02GW9ecBs0gUca4VyWPpbj+jGwQI33LVBpw+evaqv 9jZgX2b5Sdk4cF6dyU1u3deZcPOK9hWntFUXJhoTm5uXVXo/Kf3La+0dzPIzKBLXgjav kCfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=tzJcD+kBJ2WEFmUAXesHoDk4OdM6dU1dW9MAKd8FqeI=; b=CNOU4LcTMIBmnT9FCrAnwrjQ9aETbn1BnZzHz4jkMrv+KS+DWHuck/tdxThJlwL3bW yAopyptdIdCgeXeHTofcPj0oLxUrRiZ6Pf9G6R9pEDlIV/JlBs7M2nU6SqGFMNj8VdHS faQI2tcSA2TQyfBxX8RwXmRseDSLHMYTX6aRn9uT/mW0cKVzKBmuNAgP3FA1VyKpUfCj tF3aR/nCT010+Dm9CL3XfI7S93AZ0M4CG0zDPA7RI9amanwHx8KaaoDjSQ/7wzkMroix h9EV50QIL+M322Bh+GxyiKxG/ykBoozzMl3xDBBUxcaRR3lINqXVIDLvzo9qki18TJb6 EuoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vVdnpy2a; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f16-20020a056402069000b0050bcc56b528si7637463edy.111.2023.05.12.09.52.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 09:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vVdnpy2a; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C57F3870913 for ; Fri, 12 May 2023 16:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C57F3870913 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683910261; bh=tzJcD+kBJ2WEFmUAXesHoDk4OdM6dU1dW9MAKd8FqeI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vVdnpy2aUr89etfuFh1Puix1QtA/TnkWFfkDL471kpEDVSAz4EPrj9diTYaCvnqn9 0j+GMXnfCgSL330IFTLrpeOOBY/yL1x9UoKG/aVjP8PCk4FOTZDxhuvu8T0OxRKHfa 4gXOoqRhXWLLbe2pQrUw0bhrANj/GKyrkiuEu9CA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8924D385609B for ; Fri, 12 May 2023 16:48:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8924D385609B Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-604-QpcicgyRODe4e30BCivs0g-1; Fri, 12 May 2023 12:48:44 -0400 X-MC-Unique: QpcicgyRODe4e30BCivs0g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93E5480101C; Fri, 12 May 2023 16:48:44 +0000 (UTC) Received: from localhost (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A71EC15BA0; Fri, 12 May 2023 16:48:44 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Reduce dependency on _GLIBCXX_USE_C99_STDINT_TR1 Date: Fri, 12 May 2023 17:48:43 +0100 Message-Id: <20230512164843.1303299-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765707989526143601?= X-GMAIL-MSGID: =?utf-8?q?1765707989526143601?= Tested powerpc64le-linux. Pushed to trunk. -- >8 -- Since r9-2028-g8ba7f29e3dd064 we've defined most of unconditionally, so we can do the same for most of the std::atomic aliases such as std::atomic_int_least32_t. The only aliases that need to depend on _GLIBCXX_USE_C99_STDINT_TR1 are the ones for the integer types that are not guaranteed to be defined, e.g. std::atomic_int32_t. libstdc++-v3/ChangeLog: * include/std/atomic (atomic_int_least8_t, atomic_uint_least8_t) (atomic_int_least16_t, atomic_uint_least16_t) (atomic_int_least32_t, atomic_uint_least32_t) (atomic_int_least64_t, atomic_uint_least64_t) (atomic_int_fast16_t, atomic_uint_fast16_t) (atomic_int_fast32_t, atomic_uint_fast32_t) (atomic_int_fast64_t, atomic_uint_fast64_t) (atomic_intmax_t, atomic_uintmax_t): Define unconditionally. * testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Adjust. --- libstdc++-v3/include/std/atomic | 5 +---- .../testsuite/29_atomics/headers/stdatomic.h/c_compat.cc | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 96e87ded864..b502027e4a4 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -1130,7 +1130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// atomic_uint64_t typedef atomic atomic_uint64_t; - +#endif /// atomic_int_least8_t typedef atomic atomic_int_least8_t; @@ -1180,7 +1180,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// atomic_uint_fast64_t typedef atomic atomic_uint_fast64_t; -#endif /// atomic_intptr_t @@ -1195,13 +1194,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// atomic_ptrdiff_t typedef atomic atomic_ptrdiff_t; -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 /// atomic_intmax_t typedef atomic atomic_intmax_t; /// atomic_uintmax_t typedef atomic atomic_uintmax_t; -#endif // Function definitions, atomic_flag operations. inline bool diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc index edf19960cbb..8dd7054a997 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc @@ -79,6 +79,7 @@ static_assert(is_same); static_assert(is_same); static_assert(is_same); static_assert(is_same); +#endif static_assert(is_same); static_assert(is_same); static_assert(is_same); @@ -95,13 +96,10 @@ static_assert(is_same); static_assert(is_same); static_assert(is_same); static_assert(is_same); -#endif static_assert(is_same); static_assert(is_same); -#ifdef _GLIBCXX_USE_C99_STDINT_TR1 static_assert(is_same); static_assert(is_same); -#endif #include static_assert(is_same); static_assert(is_same);