mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Avoid aliasing problems by using special buf endian handling functions wrapping memcpy
This commit is contained in:
parent
4d640dac2a
commit
1636187e26
13 changed files with 68 additions and 40 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "LittleBigEndian.h"
|
||||
|
||||
#ifdef NEEDS_LOCAL_ENDIAN
|
||||
uint16_t htobe16(uint16_t int16)
|
||||
{
|
||||
BigEndian<uint16_t> u16(int16);
|
||||
|
@ -40,6 +41,7 @@ uint64_t be64toh(uint64_t big64)
|
|||
LittleEndian<uint64_t> u64(big64);
|
||||
return u64.raw_value;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* it can be used in Windows 8
|
||||
#include <Winsock2.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue