Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From 5f3a535987bae4c3e3d9e9079c7526e399f7aecd Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 22 Mar 2016 07:42:39 +0000 |
| 4 | Subject: [PATCH 2/2] endian: Use macro bswap_64 instead of __bswap_64 |
| 5 | |
| 6 | byteswap.h defines then as public APIs on all libc |
| 7 | on linux including musl |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | Upstream-Status: Submitted |
| 12 | src/endian.c | 5 +++-- |
| 13 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 14 | |
| 15 | diff --git a/src/endian.c b/src/endian.c |
| 16 | index b7724f3..51aea58 100644 |
| 17 | --- a/src/endian.c |
| 18 | +++ b/src/endian.c |
| 19 | @@ -15,6 +15,7 @@ void xle64enc(uint8_t *d, uint64_t n) { |
| 20 | #include <stdint.h> |
| 21 | #ifdef __linux__ |
| 22 | #include <endian.h> |
| 23 | + #include <byteswap.h> |
| 24 | #else |
| 25 | #include <sys/endian.h> |
| 26 | #endif |
| 27 | @@ -23,7 +24,7 @@ void xle64enc(uint8_t *d, uint64_t n) { |
| 28 | # if __BYTE_ORDER == __LITTLE_ENDIAN |
| 29 | # define htole64(x) (x) |
| 30 | # else |
| 31 | -# define htole64(x) __bswap_64 (x) |
| 32 | +# define htole64(x) bswap_64 (x) |
| 33 | # endif |
| 34 | #endif |
| 35 | |
| 36 | @@ -31,7 +32,7 @@ void xle64enc(uint8_t *d, uint64_t n) { |
| 37 | # if __BYTE_ORDER == __LITTLE_ENDIAN |
| 38 | # define le64toh(x) (x) |
| 39 | # else |
| 40 | -# define le64toh(x) __bswap_64 (x) |
| 41 | +# define le64toh(x) bswap_64 (x) |
| 42 | # endif |
| 43 | #endif |
| 44 | |
| 45 | -- |
| 46 | 1.8.3.1 |
| 47 | |