aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux/compiler.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-04-17 10:25:00 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-04-19 12:01:42 -0400
commitf6441aff8946f7fd6ab730d7eb9eba18a9ebeba4 (patch)
tree4bd16f3906dd5623bc73ae75dc006b4cf7dea48d /tools/include/linux/compiler.h
parent379d61b1c7d42512cded04d372f15a7e725db9e1 (diff)
tools include: Adopt __same_type() and __must_be_array() from the kernel
Will be used to adopt the more stringent version of ARRAY_SIZE(), the one in the kernel sources. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.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-d85dpvay1hoqscpezlntyd8x@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include/linux/compiler.h')
-rw-r--r--tools/include/linux/compiler.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index c9e65e8faacd..23299d7e7160 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -17,6 +17,11 @@
17# define __always_inline inline __attribute__((always_inline)) 17# define __always_inline inline __attribute__((always_inline))
18#endif 18#endif
19 19
20/* Are two types/vars the same type (ignoring qualifiers)? */
21#ifndef __same_type
22# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
23#endif
24
20#ifdef __ANDROID__ 25#ifdef __ANDROID__
21/* 26/*
22 * FIXME: Big hammer to get rid of tons of: 27 * FIXME: Big hammer to get rid of tons of: