public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Fix build failure with GCC 4.8
@ 2023-09-15 16:23 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-09-15 16:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Simon Marchi

A user pointed out that the build failed with GCC 4.8.  The problem
was that the form used by the std::hash specialization of ptid_t was
not accepted.  This patch rewrites this code into a form that is
acceptable to the older compiler.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdbsupport/ptid.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h
index f8644d47633..96c7d9c8bfd 100644
--- a/gdbsupport/ptid.h
+++ b/gdbsupport/ptid.h
@@ -157,8 +157,10 @@ class ptid_t
   tid_type m_tid;
 };
 
+namespace std
+{
 template<>
-struct std::hash<ptid_t>
+struct hash<ptid_t>
 {
   size_t operator() (const ptid_t &ptid) const
   {
@@ -169,6 +171,7 @@ struct std::hash<ptid_t>
 	    + long_hash (ptid.tid ()));
   }
 };
+}
 
 /* The null or zero ptid, often used to indicate no process. */
 
-- 
2.40.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-15 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15 16:23 [pushed] Fix build failure with GCC 4.8 Tom Tromey

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).