Skip to content

Commit

Permalink
Merge pull request #1208 from TheJJ/qthash-fix
Browse files Browse the repository at this point in the history
qt: don't define std::hash<QString> for qt >= 5.14
  • Loading branch information
TheJJ committed Dec 22, 2019
2 parents f6f42b0 + 663b115 commit 7ca1723
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libopenage/gui/guisys/private/livereload/gui_live_reloader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2016 the openage authors. See copying.md for legal info.
// Copyright 2015-2019 the openage authors. See copying.md for legal info.

#pragma once

Expand All @@ -9,16 +9,20 @@
#include <QStringList>
#include <QHash>
#include <QList>
#include <QtGlobal>
#include <QtQml>

// since qt 5.14, the std::hash of q* types are included in qt
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
namespace std {
template<>
struct hash<QString> {
size_t operator()(const QString& val) const throw () {
size_t operator()(const QString& val) const noexcept {
return qHash(val);
}
};
}
#endif

namespace qtsdl {

Expand Down

0 comments on commit 7ca1723

Please sign in to comment.