board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / assimp / 0002-fix-compilation-on-BigEndian.patch
blob93cba5d12065051de8be2e1563504f25525fd1bb
1 From 8457f3eff89dae35d43f679a66842ceedfd08808 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?=
3 <zmoelnig@umlautQ.umlaeute.mur.at>
4 Date: Fri, 13 Nov 2015 22:33:20 +0100
5 Subject: [PATCH] fix compilation on BigEndian
7 cannot pass a function by reference where an lvalue is expected
8 (only applies to bigendian, where a macro expands to a byteswap function)
10 Closes https://github.com/assimp/assimp/issues/613
12 Taken from [1] for buildroot assimp package compile fix.
14 [1] https://github.com/assimp/assimp/commit/756cfd4f74b866e3183caede69daa8c105b73bab.patch
16 Signed-off-by: Peter Seiderer <ps.report@gmx.net>
17 ---
18 code/Bitmap.cpp | 5 +++++
19 1 file changed, 5 insertions(+)
21 diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp
22 index 13ec372..829fd02 100644
23 --- a/code/Bitmap.cpp
24 +++ b/code/Bitmap.cpp
25 @@ -84,7 +84,12 @@ namespace Assimp {
27 template<typename T>
28 inline std::size_t Copy(uint8_t* data, T& field) {
29 +#ifdef AI_BUILD_BIG_ENDIAN
30 + T field_swapped=AI_BE(field);
31 + std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field);
32 +#else
33 std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field);
34 +#endif
37 void Bitmap::WriteHeader(Header& header, IOStream* file) {
38 --
39 2.1.4