From: Arnaldo Carvalho de Melo Date: Fri, 18 Dec 2020 13:16:08 +0000 (-0300) Subject: tools headers: Add conditional __has_builtin() X-Git-Tag: v5.11-rc1~49^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffb9beb13e8daf3fcb6bab470d07962b05d619b7;p=thirdparty%2Fkernel%2Flinux.git tools headers: Add conditional __has_builtin() As it'll be used by the ctype.h sync with its kernel source original. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h index 31fc2caa758a0..feea09029f610 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