summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seiderer <ps.report@gmx.net>2016-01-14 22:44:21 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-01-16 14:06:23 +0100
commit9ebac3bd050ee57cdd8a5ede053aed5522f5e8dc (patch)
tree2090eb6744b0fef58a5eed3f7532bda73292991e
parent25ba49518a93265ecb3146e6eb21a2a138989100 (diff)
downloadbuildroot-9ebac3bd050ee57cdd8a5ede053aed5522f5e8dc.tar.gz
buildroot-9ebac3bd050ee57cdd8a5ede053aed5522f5e8dc.zip
assimp: fix compile for big endian target
Patch taken from upstream [1]. Fixes ([2]): code/Bitmap.cpp: In function 'std::size_t Assimp::Copy(uint8_t*, T&) [with T = short unsigned int, std::size_t = unsigned int, uint8_t = unsigned char]': code/Bitmap.cpp:95:50: instantiated from here code/Bitmap.cpp:87:9: error: lvalue required as unary '&' operand [1] https://github.com/assimp/assimp/commit/756cfd4f74b866e3183caede69daa8c105b73bab.patch [2] http://autobuild.buildroot.net/results/7aa/7aafdc2633bad96a2a17f4e8664e09aae78a3bbd Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/assimp/0002-fix-compilation-on-BigEndian.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/package/assimp/0002-fix-compilation-on-BigEndian.patch b/package/assimp/0002-fix-compilation-on-BigEndian.patch
new file mode 100644
index 0000000000..93cba5d120
--- /dev/null
+++ b/package/assimp/0002-fix-compilation-on-BigEndian.patch
@@ -0,0 +1,40 @@
+From 8457f3eff89dae35d43f679a66842ceedfd08808 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?=
+ <zmoelnig@umlautQ.umlaeute.mur.at>
+Date: Fri, 13 Nov 2015 22:33:20 +0100
+Subject: [PATCH] fix compilation on BigEndian
+
+cannot pass a function by reference where an lvalue is expected
+(only applies to bigendian, where a macro expands to a byteswap function)
+
+Closes https://github.com/assimp/assimp/issues/613
+
+Taken from [1] for buildroot assimp package compile fix.
+
+[1] https://github.com/assimp/assimp/commit/756cfd4f74b866e3183caede69daa8c105b73bab.patch
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ code/Bitmap.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp
+index 13ec372..829fd02 100644
+--- a/code/Bitmap.cpp
++++ b/code/Bitmap.cpp
+@@ -84,7 +84,12 @@ namespace Assimp {
+
+ template<typename T>
+ inline std::size_t Copy(uint8_t* data, T& field) {
++#ifdef AI_BUILD_BIG_ENDIAN
++ T field_swapped=AI_BE(field);
++ std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field);
++#else
+ std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field);
++#endif
+ }
+
+ void Bitmap::WriteHeader(Header& header, IOStream* file) {
+--
+2.1.4
+
OpenPOWER on IntegriCloud