summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-12 22:57:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-14 18:14:46 +0200
commit0ba585a1d91b812158277c09aa890cedbc080790 (patch)
treee71490563640dc8ee52dbbf3a76a756c56c9f69f
parentd3aac3ed3b9bd65b8ca4cdffd0c4f09fabbc583d (diff)
compat/options: workaround lto bug on windows
-rw-r--r--opentrack-compat/options.cpp28
-rw-r--r--opentrack-compat/options.hpp28
2 files changed, 25 insertions, 31 deletions
diff --git a/opentrack-compat/options.cpp b/opentrack-compat/options.cpp
index f86e32da..783cf5ec 100644
--- a/opentrack-compat/options.cpp
+++ b/opentrack-compat/options.cpp
@@ -285,31 +285,3 @@ bool slider_value::operator==(const slider_value& v) const
} // end options
-QT_BEGIN_NAMESPACE
-
-QDebug operator << (QDebug dbg, const options::slider_value& val)
-{
- dbg.nospace() << "cur=" << val.cur()
- << ", min=" << val.min()
- << ", max=" << val.max();
-
- return dbg.space();
-}
-
-QDataStream& operator <<(QDataStream& out, const options::slider_value& v)
-{
- out << v.cur() << v.min() << v.max();
- return out;
-}
-
-QDataStream& operator >>(QDataStream& in, options::slider_value& v)
-{
- double cur, min, max;
- in >> cur;
- in >> min;
- in >> max;
- v = options::slider_value(cur, min, max);
- return in;
-}
-
-QT_END_NAMESPACE
diff --git a/opentrack-compat/options.hpp b/opentrack-compat/options.hpp
index af36ea08..e2c04929 100644
--- a/opentrack-compat/options.hpp
+++ b/opentrack-compat/options.hpp
@@ -70,10 +70,32 @@ namespace options
};
}
-QDebug operator << (QDebug dbg, const options::slider_value& val);
+QT_BEGIN_NAMESPACE
-QDataStream& operator << (QDataStream& out, const options::slider_value& v);
-QDataStream& operator >> (QDataStream& in, options::slider_value& v);
+inline QDebug operator << (QDebug dbg, const options::slider_value& val)
+{
+ return dbg << val.cur();
+}
+
+inline QDataStream& operator << (QDataStream& out, const options::slider_value& v)
+{
+ out << v.cur()
+ << v.min()
+ << v.max();
+ return out;
+}
+
+inline QDataStream& operator >> (QDataStream& in, options::slider_value& v)
+{
+ double cur, min, max;
+ in >> cur;
+ in >> min;
+ in >> max;
+ v = options::slider_value(cur, min, max);
+ return in;
+}
+
+QT_END_NAMESPACE
Q_DECLARE_METATYPE(options::slider_value)