From 3ac806b76da4f841bc168201eb314e00d4a85df1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 31 Jan 2017 13:16:06 -0800 Subject: De-inline qfloat16 streaming operators in QDataStream Which allows us to remove the #include. The qfloat16 operator overloads in the global namespace are giving some trouble on some compilers, for reasons unknown (could be compiler bug, could be real). So don't #include the header anywhere else: let the user choose it. Task-number: QTBUG-58555 Change-Id: I4c9f691516694b90b08ffffd149ef7dff27d0f6a Reviewed-by: Jani Heikkinen --- src/corelib/io/qdatastream.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qdatastream.cpp') diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index cac5152e87..2369fe4726 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -42,6 +42,7 @@ #if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED) #include "qbuffer.h" +#include "qfloat16.h" #include "qstring.h" #include #include @@ -975,7 +976,6 @@ QDataStream &QDataStream::operator>>(double &f) /*! - \fn QDataStream &QDataStream::operator>>(qfloat16 &f) \overload \since 5.9 @@ -983,6 +983,11 @@ QDataStream &QDataStream::operator>>(double &f) using the standard IEEE 754 format. Returns a reference to the stream. */ +QDataStream &QDataStream::operator>>(qfloat16 &f) +{ + return *this >> reinterpret_cast(f); +} + /*! \overload @@ -1280,6 +1285,10 @@ QDataStream &QDataStream::operator<<(double f) Writes a floating point number, \a f, to the stream using the standard IEEE 754 format. Returns a reference to the stream. */ +QDataStream &QDataStream::operator<<(qfloat16 f) +{ + return *this << reinterpret_cast(f); +} /*! \overload -- cgit v1.2.3