[Listener] Refactor endianess #defines
This commit is contained in:
parent
921afff682
commit
7499ef9ec5
|
@ -24,23 +24,25 @@
|
||||||
* version of glibc, or another libc (e.g. uClibc), we must define them
|
* version of glibc, or another libc (e.g. uClibc), we must define them
|
||||||
* manually.
|
* manually.
|
||||||
*/
|
*/
|
||||||
#ifndef le32toh
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
# ifndef le32toh
|
||||||
# define le32toh(x) (x)
|
# define le32toh(x) (x)
|
||||||
# else // __BYTE_ORDER == __LITTLE_ENDIAN
|
# endif // le32toh
|
||||||
# include <byteswap.h>
|
# ifndef le16toh
|
||||||
# define le32toh(x) bswap_32(x)
|
|
||||||
# endif // __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
#endif // le32toh
|
|
||||||
|
|
||||||
#ifndef le16toh
|
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
# define le16toh(x) (x)
|
# define le16toh(x) (x)
|
||||||
# else // __BYTE_ORDER == __LITTLE_ENDIAN
|
# endif // le16toh
|
||||||
# include <byteswap.h>
|
#else // __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
# define le16toh(x) bswap_16(x)
|
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
# endif // __BYTE_ORDER == __LITTLE_ENDIAN
|
# ifndef le32toh
|
||||||
#endif // le16toh
|
# include <byteswap.h>
|
||||||
|
# define le32toh(x) bswap_32(x)
|
||||||
|
# endif // le32toh
|
||||||
|
# ifndef le16toh
|
||||||
|
# include <byteswap.h>
|
||||||
|
# define le16toh(x) bswap_16(x)
|
||||||
|
# endif // le16toh
|
||||||
|
# endif // __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
#endif // __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
|
||||||
|
|
||||||
/* Arguments & program configuration */
|
/* Arguments & program configuration */
|
||||||
|
|
Loading…
Reference in New Issue