aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch
blob: 6b615988db7c4c96eb7b496d159248864ce21322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 5f3a535987bae4c3e3d9e9079c7526e399f7aecd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 22 Mar 2016 07:42:39 +0000
Subject: [PATCH 2/2] 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>
---
Upstream-Status: Submitted
 src/endian.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/endian.c b/src/endian.c
index b7724f3..51aea58 100644
--- a/src/endian.c
+++ b/src/endian.c
@@ -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
 
-- 
1.8.3.1