summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2020-12-18 10:16:08 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-12-18 17:32:28 -0300
commitffb9beb13e8daf3fcb6bab470d07962b05d619b7 (patch)
treeac733335cb78467357ba9926b63ce0c2cbf115f6 /tools/include
parent4bba4c4bb09ad4a2b70836725e08439c86d8f9e4 (diff)
tools headers: Add conditional __has_builtin()
As it'll be used by the ctype.h sync with its kernel source original. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/linux/compiler_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h
index 31fc2caa758a..feea09029f61 100644
--- a/tools/include/linux/compiler_types.h
+++ b/tools/include/linux/compiler_types.h
@@ -2,6 +2,17 @@
#ifndef __LINUX_COMPILER_TYPES_H
#define __LINUX_COMPILER_TYPES_H
+/* Builtins */
+
+/*
+ * __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21.
+ * In the meantime, to support gcc < 10, we implement __has_builtin
+ * by hand.
+ */
+#ifndef __has_builtin
+#define __has_builtin(x) (0)
+#endif
+
/* Compiler specific macros. */
#ifdef __GNUC__
#include <linux/compiler-gcc.h>