Peek what systemd does and do something similar. Instead of hardcoding
8, add a ptr abstraction for the aligned attribute.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/274
#define _retain_ __attribute((retain))
#define _section_(a) __attribute((section(a)))
#define _aligned_(a) __attribute((aligned(a)))
+#define _alignedptr_ _aligned_(sizeof(void *))
#if defined(__clang_analyzer__)
#define _clang_suppress_ __attribute__((suppress))
_used_ \
_retain_ \
_section_("kmod_tests") \
- _aligned_(8) \
+ _alignedptr_ \
static const struct test UNIQ(s##_name) = { \
.name = #_name, .func = _func, ##__VA_ARGS__ \
};