From 0e0edacca5f34621f85e93a22ee31c6810b5941c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 15 Sep 2023 10:13:24 -0600 Subject: [PATCH] Fix build failure with GCC 4.8 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 --- 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 @@ private: tid_type m_tid; }; +namespace std +{ template<> -struct std::hash +struct hash { size_t operator() (const ptid_t &ptid) const { @@ -169,6 +171,7 @@ struct std::hash + long_hash (ptid.tid ())); } }; +} /* The null or zero ptid, often used to indicate no process. */ -- 2.30.2