From: Arnaldo Carvalho de Melo Date: Tue, 5 Sep 2017 13:52:02 +0000 (-0300) Subject: tools include linux: Guard against redefinition of some macros X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=259d40775ee11dbeba022514815df08c57994ef3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tools include linux: Guard against redefinition of some macros When cross building to android r15c (and older versions) on Fedora 26 we notice these: /opt/android-ndk-r15c/platforms/android-24/arch-arm/usr/include/sys/cdefs.h:332:0: note: this is the location of the previous definition For __aligned, __packed and __noreturn, so guard those with ifdefs to avoid drowning useful warnings in these. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-d7w3fa9c22dtmrwbedos6ie1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h index bd39b2090ad1..3723b9f8f964 100644 --- a/tools/include/linux/compiler-gcc.h +++ b/tools/include/linux/compiler-gcc.h @@ -21,11 +21,14 @@ #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) #define noinline __attribute__((noinline)) - +#ifndef __packed #define __packed __attribute__((packed)) - +#endif +#ifndef __noreturn #define __noreturn __attribute__((noreturn)) - +#endif +#ifndef __aligned #define __aligned(x) __attribute__((aligned(x))) +#endif #define __printf(a, b) __attribute__((format(printf, a, b))) #define __scanf(a, b) __attribute__((format(scanf, a, b)))