mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 04:53:44 +02:00
ARM64 stuff
This commit is contained in:
parent
483b47474d
commit
cdbb86b830
1 changed files with 5 additions and 3 deletions
|
@ -434,7 +434,6 @@ static ZT_INLINE I loadAsIsEndian(const void *const p) noexcept
|
|||
{
|
||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||
I tmp;
|
||||
#pragma unroll
|
||||
for(int i=0;i<(int)sizeof(I);++i)
|
||||
reinterpret_cast<uint8_t *>(&tmp)[i] = reinterpret_cast<const uint8_t *>(p)[i];
|
||||
return tmp;
|
||||
|
@ -454,7 +453,6 @@ template<typename I>
|
|||
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<sizeof(I);++k)
|
||||
reinterpret_cast<uint8_t *>(p)[k] = reinterpret_cast<const uint8_t *>(&i)[k];
|
||||
#else
|
||||
|
@ -523,11 +521,15 @@ static ZT_INLINE I loadLittleEndian(const void *const p) noexcept
|
|||
template<typename I>
|
||||
static ZT_INLINE void storeLittleEndian(void *const p,const I i) noexcept
|
||||
{
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN || defined(ZT_NO_UNALIGNED_ACCESS)
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
storeAsIsEndian(p,_swap_bytes_bysize<I,sizeof(I)>::s(i));
|
||||
#else
|
||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||
storeAsIsEndian(p,i);
|
||||
#else
|
||||
*reinterpret_cast<I *>(p) = i;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
|
Loading…
Add table
Reference in a new issue