diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2024-02-26 20:03:46 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-03-13 00:00:48 -0800 |
commit | 4be7c046b1792a97e6e3e5c9dd9e3f71ffb11529 (patch) | |
tree | 9cfaa81a03cec30c680510a89345b8762262ba9c /src/corelib/kernel | |
parent | 0f56502fb6f062c6d2308198c93412c34525125b (diff) |
Bootstrap: remove QDataStream
It was only used by the cmake_automoc_parser so it would write a 64-bit
in big-endian format. So bypass QDataStream and write it native
endianness.
Change-Id: I01ec3c774d9943adb903fffd17b79c78e56db4cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index ebe79e0232..3ccff5ae5f 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -22,13 +22,14 @@ #endif #include "quuid.h" #include "qvariant.h" -#include "qdatastream.h" #if QT_CONFIG(regularexpression) # include "qregularexpression.h" #endif #ifndef QT_BOOTSTRAPPED +# include "qdatastream.h" + # include "qbitarray.h" # include "qurl.h" # include "qvariant.h" diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 5528c2f459..9c1fdeecdd 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2369,18 +2369,20 @@ struct QDebugStreamOperatorForType <T, false> template<typename T, bool = QTypeTraits::has_stream_operator_v<QDataStream, T>> struct QDataStreamOperatorForType { - static void dataStreamOut(const QMetaTypeInterface *, QDataStream &ds, const void *a) - { ds << *reinterpret_cast<const T *>(a); } - static void dataStreamIn(const QMetaTypeInterface *, QDataStream &ds, void *a) - { ds >> *reinterpret_cast<T *>(a); } + static constexpr QMetaTypeInterface::DataStreamOutFn dataStreamOut = nullptr; + static constexpr QMetaTypeInterface::DataStreamInFn dataStreamIn = nullptr; }; +#ifndef QT_NO_DATASTREAM template<typename T> -struct QDataStreamOperatorForType <T, false> +struct QDataStreamOperatorForType <T, true> { - static constexpr QMetaTypeInterface::DataStreamOutFn dataStreamOut = nullptr; - static constexpr QMetaTypeInterface::DataStreamInFn dataStreamIn = nullptr; + static void dataStreamOut(const QMetaTypeInterface *, QDataStream &ds, const void *a) + { ds << *reinterpret_cast<const T *>(a); } + static void dataStreamIn(const QMetaTypeInterface *, QDataStream &ds, void *a) + { ds >> *reinterpret_cast<T *>(a); } }; +#endif // Performance optimization: // |