overte/tools/qt-builder/patches/qfloat16.patch
2019-04-21 20:18:59 -07:00

44 lines
1.5 KiB
Diff

diff --git a/qtbase/src/corelib/global/qfloat16.h b/qtbase/src/corelib/global/qfloat16.h
index 3e50ad8467..2453ff8847 100644
--- a/qtbase/src/corelib/global/qfloat16.h
+++ b/qtbase/src/corelib/global/qfloat16.h
@@ -83,7 +83,9 @@ private:
Q_CORE_EXPORT static const quint32 shifttable[];
friend bool qIsNull(qfloat16 f) Q_DECL_NOTHROW;
+#if ! defined(QT_NO_FLOAT16_OPERATORS)
friend qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW;
+#endif
};
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
@@ -165,6 +167,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
}
#endif
+#if ! defined(QT_NO_FLOAT16_OPERATORS)
inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
{
qfloat16 f;
@@ -206,11 +209,12 @@ QF16_MAKE_ARITH_OP_INT(-)
QF16_MAKE_ARITH_OP_INT(*)
QF16_MAKE_ARITH_OP_INT(/)
#undef QF16_MAKE_ARITH_OP_INT
-
+#endif
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
+#if ! defined(QT_NO_FLOAT16_OPERATORS)
inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) > static_cast<float>(b); }
inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) < static_cast<float>(b); }
inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) >= static_cast<float>(b); }
@@ -244,6 +248,7 @@ QF16_MAKE_BOOL_OP_INT(<=)
QF16_MAKE_BOOL_OP_INT(==)
QF16_MAKE_BOOL_OP_INT(!=)
#undef QF16_MAKE_BOOL_OP_INT
+#endif
QT_WARNING_POP