diff options
| author | Josh Ferrell <josh@vector35.com> | 2025-05-07 13:47:14 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2025-05-07 13:47:14 -0400 |
| commit | bb753ec5f787f4b26813cfdb553c737140b12821 (patch) | |
| tree | 76383f1bcf52839d6152e32f70dbad5f2bc0a722 | |
| parent | 9b8a5a4a6a39374acbcacd95819e9f02aacddafc (diff) | |
Fix compiler error with g++15
| -rw-r--r-- | ui/xreflist.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/ui/xreflist.h b/ui/xreflist.h index ea1ce610..3f35e168 100644 --- a/ui/xreflist.h +++ b/ui/xreflist.h @@ -117,17 +117,25 @@ class XrefItem int row() const; bool operator==(const XrefItem& other) const; bool operator!=(const XrefItem& other) const; - size_t operator()(const XrefItem& item) const +}; + +namespace std +{ + template<> struct hash<XrefItem> { - size_t hash = std::hash<uint64_t>()(item.addr()); - hash ^= std::hash<int>()(item.type()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - hash ^= std::hash<int>()(item.direction()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - hash ^= std::hash<int>()(item.kind()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - hash ^= std::hash<size_t>()(item.instrId()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - hash ^= std::hash<uint64_t>()(item.func() ? item.func()->GetStart() : 0) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - hash ^= std::hash<int>()(item.ilType()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); - return hash; - } + typedef XrefItem argument_type; + size_t operator()(argument_type const& item) const + { + size_t hash = std::hash<uint64_t>()(item.addr()); + hash ^= std::hash<int>()(item.type()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash<int>()(item.direction()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash<int>()(item.kind()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash<size_t>()(item.instrId()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash<uint64_t>()(item.func() ? item.func()->GetStart() : 0) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + hash ^= std::hash<int>()(item.ilType()) + 0x9e3779b9 + (hash << 6) + (hash >> 2); + return hash; + } + }; }; /*! |
