From 4bb47b625ca28c29a078eb266e86c652936da6ce Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Tue, 26 May 2015 14:23:06 -0400 Subject: [PATCH] Add __aligned(x) and __packed macros to GCC toolchain The names "__aligned(x)" and "__packed" are more generic than ALIGN_STRUCT(x) and PACK_STRUCT respectively and are to be used in their stead. NOTE: ALIGN_STRUCT(x) and PACK_STRUCT are now considered obsolete. Change-Id: Ic5e859092643dde53bb8fa1117c6d877c2c4296f Signed-off-by: Peter Mitsis --- include/toolchain/gcc.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/toolchain/gcc.h b/include/toolchain/gcc.h index 6212ce0ae89..e9b167faca9 100644 --- a/include/toolchain/gcc.h +++ b/include/toolchain/gcc.h @@ -99,9 +99,17 @@ __extension__ ({ \ #define _GENERIC_SECTION(segment) __attribute__((section(#segment))) +/* + * Do not use either PACK_STRUCT or ALIGN_STRUCT(x). + * Use __packed or __aligned(x) instead. + */ + #define PACK_STRUCT __attribute__((__packed__)) #define ALIGN_STRUCT(x) __attribute__((aligned(x))) +#define __packed __attribute__((__packed__)) +#define __aligned(x) __attribute__((aligned(x))) + #define ARG_UNUSED(x) (void)(x) #define likely(x) __builtin_expect((long)!!(x), 1L)