SHA256
1
0
forked from pool/libqt5-qt3d
libqt5-qt3d/fix-assimp-bigendian-lvalue.diff

18 lines
697 B
Diff

Index: qt3d-opensource-src-5.6.0/src/3rdparty/3rdparty/assimp/code/Bitmap.cpp
===================================================================
--- qt3d-opensource-src-5.6.0.orig/src/3rdparty/assimp/code/Bitmap.cpp
+++ qt3d-opensource-src-5.6.0/src/3rdparty/3rdparty/assimp/code/Bitmap.cpp
@@ -82,7 +82,12 @@ namespace Assimp {
template<typename T>
inline std::size_t Copy(uint8_t* data, T& field) {
+#if (defined AI_BUILD_BIG_ENDIAN)
+ T swapped=AI_BE(field);
+ std::memcpy(data, &swapped, sizeof(swapped)); return sizeof(field);
+#else
std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field);
+#endif
}
void Bitmap::WriteHeader(Header& header, IOStream* file) {