aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-09-05 09:52:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-09-12 11:33:39 -0400
commit259d40775ee11dbeba022514815df08c57994ef3 (patch)
tree38904ce4fc07115ae7a75044f2dabe99f8d95eca /tools/include/linux
parent770e96125515daf1c7bc179323f2e0d488dfe6ac (diff)
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>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/compiler-gcc.h9
1 files changed, 6 insertions, 3 deletions
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 @@
21#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) 21#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
22 22
23#define noinline __attribute__((noinline)) 23#define noinline __attribute__((noinline))
24 24#ifndef __packed
25#define __packed __attribute__((packed)) 25#define __packed __attribute__((packed))
26 26#endif
27#ifndef __noreturn
27#define __noreturn __attribute__((noreturn)) 28#define __noreturn __attribute__((noreturn))
28 29#endif
30#ifndef __aligned
29#define __aligned(x) __attribute__((aligned(x))) 31#define __aligned(x) __attribute__((aligned(x)))
32#endif
30#define __printf(a, b) __attribute__((format(printf, a, b))) 33#define __printf(a, b) __attribute__((format(printf, a, b)))
31#define __scanf(a, b) __attribute__((format(scanf, a, b))) 34#define __scanf(a, b) __attribute__((format(scanf, a, b)))