blob: 231503d9eb67ec709b5fa58e2241b80656b7c001 [file] [log] [blame]
David Holm98806532014-12-01 21:19:18 +01001#ifndef GSM_ENDIAN_H
2#define GSM_ENDIAN_H
3
4#if defined(__linux__)
5# include <endian.h>
6#elif defined(__APPLE__)
7# include <libkern/OSByteOrder.h>
8
9# define htobe16(x) OSSwapHostToBigInt16(x)
10# define htobe32(x) OSSwapHostToBigInt32(x)
11
Martin Jesper Low Madsenaf769642015-04-28 22:33:43 +020012# define be16toh(x) OSSwapBigToHostInt16(x)
David Holm98806532014-12-01 21:19:18 +010013# define be32toh(x) OSSwapBigToHostInt32(x)
14#endif
15
16#endif /* GSM_ENDIAN_H */