diff --git a/lib/libc/include/sys/cdefs.h b/lib/libc/include/sys/cdefs.h index 5f794618..e30c1ff7 100644 --- a/lib/libc/include/sys/cdefs.h +++ b/lib/libc/include/sys/cdefs.h @@ -56,25 +56,6 @@ #define __BEGIN_DECLS __BEGIN_CDECLS #define __END_DECLS __END_CDECLS -/* - * Testing against Clang-specific extensions. - */ -#ifndef __has_attribute -#define __has_attribute(x) 0 -#endif -#ifndef __has_extension -#define __has_extension __has_feature -#endif -#ifndef __has_feature -#define __has_feature(x) 0 -#endif -#ifndef __has_include -#define __has_include(x) 0 -#endif -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - /*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly diff --git a/top/include/lk/compiler.h b/top/include/lk/compiler.h index 04236826..d00104b0 100644 --- a/top/include/lk/compiler.h +++ b/top/include/lk/compiler.h @@ -138,11 +138,26 @@ #define __FALLTHROUGH do {} while (0) #endif +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif +#ifndef __has_extension +#define __has_extension __has_feature +#endif +#ifndef __has_feature +#define __has_feature(x) 0 +#endif +#ifndef __has_include +#define __has_include(x) 0 +#endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + #ifndef __clang__ #define __LEAF_FN __attribute__((__leaf__)) #define __OPTIMIZE(x) __attribute__((optimize(x))) #define __THREAD_ANNOTATION(x) -#define __has_feature(x) 0 #else #define __LEAF_FN #define __OPTIMIZE(x)