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 <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-d7w3fa9c22dtmrwbedos6ie1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+6 -3
+6 -3
tools/include/linux/compiler-gcc.h
··· 21 21 #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) 22 22 23 23 #define noinline __attribute__((noinline)) 24 - 24 + #ifndef __packed 25 25 #define __packed __attribute__((packed)) 26 - 26 + #endif 27 + #ifndef __noreturn 27 28 #define __noreturn __attribute__((noreturn)) 28 - 29 + #endif 30 + #ifndef __aligned 29 31 #define __aligned(x) __attribute__((aligned(x))) 32 + #endif 30 33 #define __printf(a, b) __attribute__((format(printf, a, b))) 31 34 #define __scanf(a, b) __attribute__((format(scanf, a, b)))