Idwer Vollering has uploaded this change for review. ( https://review.coreboot.org/20924
Change subject: util/cbmem, util/cbfstool: resolve macro errors on FreeBSD ......................................................................
util/cbmem, util/cbfstool: resolve macro errors on FreeBSD
Using sys/cdefs.h would come to mind, however this include would not solve the build error. Built and runtime tested on FreeBSD 12.0-CURRENT, r322031
Change-Id: I6ec9bc7fea72aa69a41439e002f381bd5e5b6bc6 Signed-off-by: Idwer Vollering vidwer@gmail.com --- M util/cbfstool/compiler.h M util/cbmem/compiler.h 2 files changed, 6 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/20924/1
diff --git a/util/cbfstool/compiler.h b/util/cbfstool/compiler.h index a830239..80d2476 100644 --- a/util/cbfstool/compiler.h +++ b/util/cbfstool/compiler.h @@ -18,11 +18,12 @@
#if defined(__WIN32) || defined(__WIN64) #define __packed __attribute__((gcc_struct, packed)) -#else +#endif +#if !defined(__FreeBSD__) #define __packed __attribute__((packed)) +#define __aligned(x) __attribute__((aligned(x))) #endif
-#define __aligned(x) __attribute__((aligned(x))) #define __always_unused __attribute__((unused)) #define __must_check __attribute__((warn_unused_result))
diff --git a/util/cbmem/compiler.h b/util/cbmem/compiler.h index a830239..80d2476 100644 --- a/util/cbmem/compiler.h +++ b/util/cbmem/compiler.h @@ -18,11 +18,12 @@
#if defined(__WIN32) || defined(__WIN64) #define __packed __attribute__((gcc_struct, packed)) -#else +#endif +#if !defined(__FreeBSD__) #define __packed __attribute__((packed)) +#define __aligned(x) __attribute__((aligned(x))) #endif
-#define __aligned(x) __attribute__((aligned(x))) #define __always_unused __attribute__((unused)) #define __must_check __attribute__((warn_unused_result))