Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11
+11
tools/include/linux/compiler_types.h
··· 2 2 #ifndef __LINUX_COMPILER_TYPES_H 3 3 #define __LINUX_COMPILER_TYPES_H 4 4 5 + /* Builtins */ 6 + 7 + /* 8 + * __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21. 9 + * In the meantime, to support gcc < 10, we implement __has_builtin 10 + * by hand. 11 + */ 12 + #ifndef __has_builtin 13 + #define __has_builtin(x) (0) 14 + #endif 15 + 5 16 /* Compiler specific macros. */ 6 17 #ifdef __GNUC__ 7 18 #include <linux/compiler-gcc.h>