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
pull/689/head
IOhannes m zmölnig 2015-11-13 22:33:20 +01:00
parent e6ac1ed66a
commit 756cfd4f74
1 changed files with 5 additions and 0 deletions

View File

@ -84,7 +84,12 @@ namespace Assimp {
template<typename T> template<typename T>
inline std::size_t Copy(uint8_t* data, T& field) { 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); std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field);
#endif
} }
void Bitmap::WriteHeader(Header& header, IOStream* file) { void Bitmap::WriteHeader(Header& header, IOStream* file) {