aboutsummaryrefslogtreecommitdiffstats
path: root/main/bluez/0001-shared-include-endian.h-for-be32toh-htobe32-and-htob.patch
blob: 53eaf7763e2d92e824af6adab9747556d031f652 (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
48
49
From 16fc9188b9de0e15454a31072b9636b9fa683d89 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 14 Mar 2014 07:27:33 +0000
Subject: [PATCH 1/3] shared: include endian.h for be32toh, htobe32 and htobe64
 functions

The man page says that #include <endian.h> is needed for those.

This fixes the following compile error when building with musl libc on
Alpine Linux:

src/shared/btsnoop.o: In function `btsnoop_write':
.../src/bluez/src/shared/btsnoop.c:208: undefined reference to `htobe32'
.../src/bluez/src/shared/btsnoop.c:209: undefined reference to `htobe32'
.../src/bluez/src/shared/btsnoop.c:210: undefined reference to `htobe32'
.../src/bluez/src/shared/btsnoop.c:211: undefined reference to `htobe32'
.../src/bluez/src/shared/btsnoop.c:212: undefined reference to `htobe64'
src/shared/btsnoop.o: In function `btsnoop_open':
.../src/bluez/src/shared/btsnoop.c:100: undefined reference to `be32toh'
.../src/bluez/src/shared/btsnoop.c:103: undefined reference to `be32toh'
src/shared/btsnoop.o: In function `btsnoop_create':
.../src/bluez/src/shared/btsnoop.c:151: undefined reference to `htobe32'
.../src/bluez/src/shared/btsnoop.c:152: undefined reference to `htobe32'
src/shared/btsnoop.o: In function `pklg_read_hci':
.../src/bluez/src/shared/btsnoop.c:336: undefined reference to `be32toh'
.../src/bluez/src/shared/btsnoop.c:338: undefined reference to `be64toh'
src/shared/btsnoop.o: In function `btsnoop_read_hci':
.../src/bluez/src/shared/btsnoop.c:416: undefined reference to `be32toh'
.../src/bluez/src/shared/btsnoop.c:417: undefined reference to `be32toh'
.../src/bluez/src/shared/btsnoop.c:419: undefined reference to `be64toh'
---
 src/shared/btsnoop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/btsnoop.c b/src/shared/btsnoop.c
index d2b3b4b..17a872c 100644
--- a/src/shared/btsnoop.c
+++ b/src/shared/btsnoop.c
@@ -25,6 +25,7 @@
 #include <config.h>
 #endif
 
+#include <endian.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
-- 
1.9.0