Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame^] | 1 | From cdbbe227594665145e9309a9ecb7d90aad070aab Mon Sep 17 00:00:00 2001 |
| 2 | From: Max Krummenacher <max.krummenacher@toradex.com> |
| 3 | Date: Wed, 1 Jun 2022 15:53:55 +0000 |
| 4 | Subject: [PATCH] provide 64bit host to network conversion macros |
| 5 | |
| 6 | musl dosn't include the macros which convert 64-bit integers |
| 7 | between host and network endianness from arpa/inet.h as glibc does. |
| 8 | |
| 9 | Use this patch to include endian.h in util.h if compiling for musl. |
| 10 | |
| 11 | Prevents: |
| 12 | | [2/8] aarch64-tdx-linux-musl-gcc ... -o libavtp.so.0.2.0.p/src_avtp_stream.c.o -c ../git/src/avtp_stream.c |
| 13 | | ../git/src/avtp_stream.c: In function 'avtp_stream_pdu_get': |
| 14 | | ../git/src/avtp_stream.c:116:24: warning: implicit declaration of function 'be64toh' [-Wimplicit-function-declaration] |
| 15 | | 116 | *val = be64toh(pdu->stream_id); |
| 16 | | | ^~~~~~~ |
| 17 | | ../git/src/avtp_stream.c: In function 'avtp_stream_pdu_set': |
| 18 | | ../git/src/avtp_stream.c:199:34: warning: implicit declaration of function 'htobe64' [-Wimplicit-function-declaration] |
| 19 | | 199 | pdu->stream_id = htobe64(value); |
| 20 | |
| 21 | Upstream-Status: Inappropriate [musl specific] |
| 22 | |
| 23 | Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> |
| 24 | --- |
| 25 | src/util.h | 2 ++ |
| 26 | 1 file changed, 2 insertions(+) |
| 27 | |
| 28 | diff --git a/src/util.h b/src/util.h |
| 29 | index 8b50625..e6fd2ef 100644 |
| 30 | --- a/src/util.h |
| 31 | +++ b/src/util.h |
| 32 | @@ -27,6 +27,8 @@ |
| 33 | |
| 34 | #pragma once |
| 35 | |
| 36 | +#include <endian.h> |
| 37 | + |
| 38 | #define BIT(n) (1ULL << n) |
| 39 | |
| 40 | #define BITMASK(len) (BIT(len) - 1) |
| 41 | -- |
| 42 | 2.20.1 |
| 43 | |