endian: Use macro bswap_64 instead of __bswap_64

byteswap.h defines then as public APIs on all libc
on linux including musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
pull/61/head
Khem Raj 8 years ago
parent a224836798
commit 5ed67fc86f

@ -15,6 +15,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
#include <stdint.h>
#ifdef __linux__
#include <endian.h>
#include <byteswap.h>
#else
#include <sys/endian.h>
#endif
@ -23,7 +24,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define htole64(x) (x)
# else
# define htole64(x) __bswap_64 (x)
# define htole64(x) bswap_64 (x)
# endif
#endif
@ -31,7 +32,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define le64toh(x) (x)
# else
# define le64toh(x) __bswap_64 (x)
# define le64toh(x) bswap_64 (x)
# endif
#endif

Loading…
Cancel
Save