qfloat16: remove the metatype dependency

This macro usage is not correct. I don't know what it is for because the
documentation next to it describes how to use it, not why one should use
it. Anyway, it's most definitely the incorrect solution for whatever
problem there may have been, so remove.

I also couldn't move it to removed_api.cpp. If I do, then the
QMetaTypeInterface created for qfloat16 misses the pointers to
QDataStream. I'm not sure why... I think it's because the operator>> and
operator<< become ambiguous, so the SFINAE to check if they exist gives
up.

Change-Id: I3d74c753055744deb8acfffd17247e1d2317f11c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
Thiago Macieira 2022-11-04 14:13:45 -07:00
parent 9cc0fc385e
commit 21950e3085
3 changed files with 5 additions and 3 deletions

View File

@ -369,6 +369,7 @@ void QXmlStreamReader::addData(const char *data)
#endif // QT_CONFIG(xmlstreamreader)
// inlined API
#include "qfloat16.h"
#include "qstring.h"
#endif // QT_CORE_REMOVED_SINCE(6, 5)

View File

@ -7,7 +7,10 @@
#include <cmath> // for fpclassify()'s return values
#include <QtCore/qdatastream.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qtextstream.h>
QT_DECL_METATYPE_EXTERN(qfloat16, Q_CORE_EXPORT)
QT_BEGIN_NAMESPACE
QT_IMPL_METATYPE_EXTERN(qfloat16)

View File

@ -6,7 +6,7 @@
#define QFLOAT16_H
#include <QtCore/qglobal.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qmath.h>
#include <QtCore/qnamespace.h>
#include <limits>
#include <string.h>
@ -345,8 +345,6 @@ inline auto qHypot(qfloat16 x, qfloat16 y, qfloat16 z)
QT_END_NAMESPACE
QT_DECL_METATYPE_EXTERN(qfloat16, Q_CORE_EXPORT)
namespace std {
template<>
class numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> : public numeric_limits<float>