diff --git a/node/Utils.hpp b/node/Utils.hpp index 0c3c8c3d0..99d24be8f 100644 --- a/node/Utils.hpp +++ b/node/Utils.hpp @@ -433,11 +433,11 @@ template static ZT_INLINE I loadAsIsEndian(const void *const p) noexcept { #ifdef ZT_NO_UNALIGNED_ACCESS -#if __BYTE_ORDER == __LITTLE_ENDIAN - return _load_le_bysize::l(reinterpret_cast(p)); -#else - return _load_be_bysize::l(reinterpret_cast(p)); -#endif + I tmp; +#pragma unroll + for(int i=0;i<(int)sizeof(I);++i) + reinterpret_cast(&tmp)[i] = reinterpret_cast(p)[i]; + return tmp; #else return *reinterpret_cast(p); #endif @@ -454,6 +454,7 @@ template static ZT_INLINE void storeAsIsEndian(void *const p,const I i) noexcept { #ifdef ZT_NO_UNALIGNED_ACCESS +#pragma unroll for(unsigned int k=0;k(p)[k] = reinterpret_cast(&i)[k]; #else