mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
ARM64 stuff
This commit is contained in:
parent
1d314858ef
commit
483b47474d
1 changed files with 6 additions and 5 deletions
|
@ -433,11 +433,11 @@ template<typename I>
|
||||||
static ZT_INLINE I loadAsIsEndian(const void *const p) noexcept
|
static ZT_INLINE I loadAsIsEndian(const void *const p) noexcept
|
||||||
{
|
{
|
||||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
I tmp;
|
||||||
return _load_le_bysize<I,sizeof(I)>::l(reinterpret_cast<const uint8_t *>(p));
|
#pragma unroll
|
||||||
#else
|
for(int i=0;i<(int)sizeof(I);++i)
|
||||||
return _load_be_bysize<I,sizeof(I)>::l(reinterpret_cast<const uint8_t *>(p));
|
reinterpret_cast<uint8_t *>(&tmp)[i] = reinterpret_cast<const uint8_t *>(p)[i];
|
||||||
#endif
|
return tmp;
|
||||||
#else
|
#else
|
||||||
return *reinterpret_cast<const I *>(p);
|
return *reinterpret_cast<const I *>(p);
|
||||||
#endif
|
#endif
|
||||||
|
@ -454,6 +454,7 @@ template<typename I>
|
||||||
static ZT_INLINE void storeAsIsEndian(void *const p,const I i) noexcept
|
static ZT_INLINE void storeAsIsEndian(void *const p,const I i) noexcept
|
||||||
{
|
{
|
||||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||||
|
#pragma unroll
|
||||||
for(unsigned int k=0;k<sizeof(I);++k)
|
for(unsigned int k=0;k<sizeof(I);++k)
|
||||||
reinterpret_cast<uint8_t *>(p)[k] = reinterpret_cast<const uint8_t *>(&i)[k];
|
reinterpret_cast<uint8_t *>(p)[k] = reinterpret_cast<const uint8_t *>(&i)[k];
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue