From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 0FE3438543BA; Fri, 13 Jan 2023 00:15:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FE3438543BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673568926; bh=PlNJmMyFQs3+beWhINIHs5vZ0Yy9Br/u9D5YZKCDEVI=; h=From:To:Subject:Date:From; b=QuUr4ahWZWqG0IQSSu86/+uuBzx73iiM/mQKNPlDmBDYfXJvWGh+CCJy6Ntm6UHF0 FNbvTUtLYBn6G+eBv+ETC+ssuFOMSM+v39XzUmo8Oic4A4bDhUBJRAvVCY2/zM89Q9 V3RqkhJN5Xqul/1VoO7ET0IXv4ozUvk7qcUGkM3Q= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-5131] libstdc++: Do not include in concurrency headers X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: c0597d81b13c0cac41a9381fc5f3e6c73aa2ccaf X-Git-Newrev: 227351345d0caa596eff8325144f15b15f704c08 Message-Id: <20230113001526.0FE3438543BA@sourceware.org> Date: Fri, 13 Jan 2023 00:15:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:227351345d0caa596eff8325144f15b15f704c08 commit r13-5131-g227351345d0caa596eff8325144f15b15f704c08 Author: Jonathan Wakely Date: Thu Jan 12 13:03:01 2023 +0000 libstdc++: Do not include in concurrency headers The , , and headers use std::errc constants, but don't use std::system_error itself. They only use the __throw_system_error(int) function, which is defined in . By including the header for the errc constants instead of the whole of we avoid depending on the whole std::string definition. libstdc++-v3/ChangeLog: * include/bits/std_mutex.h: Remove include. * include/std/condition_variable: Add include. * include/std/mutex: Likewise. * include/std/shared_mutex: Likewise. Diff: --- libstdc++-v3/include/bits/std_mutex.h | 1 - libstdc++-v3/include/std/condition_variable | 3 ++- libstdc++-v3/include/std/mutex | 2 +- libstdc++-v3/include/std/shared_mutex | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/bits/std_mutex.h b/libstdc++-v3/include/bits/std_mutex.h index 68f5fb9ed65..bc515358d23 100644 --- a/libstdc++-v3/include/bits/std_mutex.h +++ b/libstdc++-v3/include/bits/std_mutex.h @@ -36,7 +36,6 @@ # include #else -#include #include #include diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable index b885e1baa1b..f671fe4afe1 100644 --- a/libstdc++-v3/include/std/condition_variable +++ b/libstdc++-v3/include/std/condition_variable @@ -38,6 +38,7 @@ #else #include +#include #include #include #include @@ -372,7 +373,7 @@ _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2) { return __p(); } - + std::stop_callback __cb(__stoken, [this] { notify_all(); }); shared_ptr __mutex = _M_mutex; while (!__p()) diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index aca5f91e03c..4eedbe5038c 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -40,8 +40,8 @@ #include #include #include -#include #include +#include #include #include #if ! _GTHREAD_USE_MUTEX_TIMEDLOCK diff --git a/libstdc++-v3/include/std/shared_mutex b/libstdc++-v3/include/std/shared_mutex index 7b70697f178..57c3cc54d81 100644 --- a/libstdc++-v3/include/std/shared_mutex +++ b/libstdc++-v3/include/std/shared_mutex @@ -36,6 +36,7 @@ #if __cplusplus >= 201402L #include +#include #include #include // move, __exchange #include // defer_lock_t