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