Origin: https://github.com/chunkeey/carl9170fw/pull/8 From: Bastian Germann Date: Thu, 30 Jul 2026 19:51:08 +0200 Subject: [PATCH 5/7] Include GCC's stddef.h over newlib's cdefs.h Make up for some missing definitions by moving __attribute__ defines. Signed-off-by: Bastian Germann --- include/linux/compiler.h | 3 +++ include/linux/types.h | 2 +- tools/lib/carlfw.h | 8 -------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5d554d7..772e55e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -30,6 +30,9 @@ #ifndef __attribute_const__ #define __attribute_const__ __attribute__((__const__)) #endif +#define __packed __attribute__((packed)) +#define __unused __attribute__((unused)) +#define __aligned(x) __attribute__((aligned(x))) #include "swab.h" #include "little_endian.h" diff --git a/include/linux/types.h b/include/linux/types.h index 42762c9..4cdd395 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #error "big endian is not supported by target" diff --git a/tools/lib/carlfw.h b/tools/lib/carlfw.h index 1207e70..6e722c9 100644 --- a/tools/lib/carlfw.h +++ b/tools/lib/carlfw.h @@ -18,14 +18,6 @@ #ifndef __CARLFW_H #define __CARLFW_H -/* These macros are already defined as part of newlib's sys/cdefs.h. - * However they are not part of standard libc which is used to compile - * the host tools. For now, simply add them here. - */ -#define __packed __attribute__((packed)) -#define __unused __attribute__((unused)) -#define __aligned(x) __attribute__((aligned(x))) - #include #include "compiler.h" #include "fwdesc.h"