b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> |
| 3 | Date: Thu, 8 Aug 2024 09:19:01 +0200 |
| 4 | Subject: libnetlink: fix build with musl and gcc 14 |
| 5 | |
| 6 | Fixes compilation error with musl libc and gcc 14: |
| 7 | |
| 8 | ../include/libnetlink.h: In function 'rta_getattr_be64': |
| 9 | ../include/libnetlink.h:280:16: error: implicit declaration of function 'htobe64' [-Wimplicit-function-declaration] |
| 10 | 280 | return htobe64(rta_getattr_u64(rta)); |
| 11 | | ^~~~~~~ |
| 12 | |
| 13 | Reference: https://man7.org/linux/man-pages/man3/endian.3.html |
| 14 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> |
| 15 | --- |
| 16 | include/libnetlink.h | 1 + |
| 17 | 1 file changed, 1 insertion(+) |
| 18 | |
| 19 | --- a/include/libnetlink.h |
| 20 | +++ b/include/libnetlink.h |
| 21 | @@ -2,6 +2,7 @@ |
| 22 | #ifndef __LIBNETLINK_H__ |
| 23 | #define __LIBNETLINK_H__ 1 |
| 24 | |
| 25 | +#include <endian.h> |
| 26 | #include <stdio.h> |
| 27 | #include <string.h> |
| 28 | #include <asm/types.h> |