aboutsummaryrefslogtreecommitdiff
path: root/tools/build
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build')
-rw-r--r--tools/build/Makefile4
-rw-r--r--tools/build/cross-build/include/common/sys/cdefs.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 09351900599a..fdec5f11311d 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -85,6 +85,10 @@ INCS+= stdlib.h
SRCS+= reallocarray.c
.endif
+.if !exists(${HOST_INCLUDE_ROOT}/stdckdint.h)
+INCS+= stdckdint.h
+.endif
+
.if exists(${HOST_INCLUDE_ROOT}/sys/stat.h)
_WITH_UTIMENS!= grep -c utimensat ${HOST_INCLUDE_ROOT}/sys/stat.h || true
.else
diff --git a/tools/build/cross-build/include/common/sys/cdefs.h b/tools/build/cross-build/include/common/sys/cdefs.h
index 3f9b7866141f..faad5eccb3af 100644
--- a/tools/build/cross-build/include/common/sys/cdefs.h
+++ b/tools/build/cross-build/include/common/sys/cdefs.h
@@ -270,6 +270,16 @@
#define __ISO_C_VISIBLE 2011
#define __EXT1_VISIBLE 1
+/*
+ * Macro to test if we're using a specific version of gcc or later.
+ */
+#if defined(__GNUC__)
+#define __GNUC_PREREQ__(ma, mi) \
+ (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
+#else
+#define __GNUC_PREREQ__(ma, mi) 0
+#endif
+
/* Alignment builtins for better type checking and improved code generation. */
/* Provide fallback versions for other compilers (GCC/Clang < 10): */
#if !__has_builtin(__builtin_is_aligned)