blob: 620be0c19e54662a470ffb6e37715f886cebd80a (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#include <endian.h> // for le16toh
#include <stdint.h> // for uint16_t
uint16_t le16toh(uint16_t little_endian_16bits)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
return little_endian_16bits;
#else
return __builtin_bswap16(little_endian_16bits);
#endif
}
|