public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-3060] libstdc++: Enable std::hash<coroutine_handle<P>> [PR107139]
Date: Tue,  4 Oct 2022 14:07:09 +0000 (GMT)	[thread overview]
Message-ID: <20221004140709.9A1F83858011@sourceware.org> (raw)

https://gcc.gnu.org/g:b74ab7a1609f01afaab9b82cfabfb96ae9e1145d

commit r13-3060-gb74ab7a1609f01afaab9b82cfabfb96ae9e1145d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 4 09:37:14 2022 +0100

    libstdc++: Enable std::hash<coroutine_handle<P>> [PR107139]
    
    Everything that <coroutine> depends on is available for freestanding
    now.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/107139
            * include/std/coroutine: Remove all _GLIBCXXHOSTED preprocessor
            conditionals.

Diff:
---
 libstdc++-v3/include/std/coroutine | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libstdc++-v3/include/std/coroutine b/libstdc++-v3/include/std/coroutine
index f4189c7e3fc..ebaf11d701f 100644
--- a/libstdc++-v3/include/std/coroutine
+++ b/libstdc++-v3/include/std/coroutine
@@ -39,7 +39,7 @@
 # include <compare>
 #endif
 
-#if !defined __cpp_lib_three_way_comparison && _GLIBCXX_HOSTED
+#if !defined __cpp_lib_three_way_comparison
 # include <bits/stl_function.h> // for std::less
 #endif
 
@@ -165,11 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   constexpr bool
   operator<(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
   {
-#if _GLIBCXX_HOSTED
     return less<void*>()(__a.address(), __b.address());
-#else
-    return (__UINTPTR_TYPE__)__a.address() < (__UINTPTR_TYPE__)__b.address();
-#endif
   }
 
   constexpr bool
@@ -343,7 +339,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   } // namespace __n4861
 
-#if _GLIBCXX_HOSTED
   template<typename _Tp> struct hash;
 
   template<typename _Promise>
@@ -355,10 +350,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	return reinterpret_cast<size_t>(__h.address());
       }
     };
-#endif
 
 #else
-#error "the coroutine header requires -fcoroutines"
+#error "the <coroutine> header requires -fcoroutines"
 #endif
 
   _GLIBCXX_END_NAMESPACE_VERSION

                 reply	other threads:[~2022-10-04 14:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221004140709.9A1F83858011@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).