summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/bsd-headers/bsd-headers.bb2
-rw-r--r--meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h26
2 files changed, 28 insertions, 0 deletions
diff --git a/meta/recipes-core/bsd-headers/bsd-headers.bb b/meta/recipes-core/bsd-headers/bsd-headers.bb
index ae659abec4..12a2cca2c9 100644
--- a/meta/recipes-core/bsd-headers/bsd-headers.bb
+++ b/meta/recipes-core/bsd-headers/bsd-headers.bb
@@ -7,6 +7,7 @@ SECTION = "devel"
SRC_URI = "file://sys-queue.h \
file://sys-tree.h \
+ file://sys-cdefs.h \
"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
@@ -18,6 +19,7 @@ S = "${WORKDIR}"
do_install() {
install -Dm 0644 ${S}/sys-queue.h ${D}${includedir}/sys/queue.h
install -Dm 0644 ${S}/sys-tree.h ${D}${includedir}/sys/tree.h
+ install -Dm 0644 ${S}/sys-cdefs.h ${D}${includedir}/sys/cdefs.h
}
#
# We will skip parsing for non-musl systems
diff --git a/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h b/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h
new file mode 100644
index 0000000000..209a623c0f
--- /dev/null
+++ b/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h
@@ -0,0 +1,26 @@
+#warning usage of non-standard #include <sys/cdefs.h> is deprecated
+
+#undef __P
+#undef __PMT
+
+#define __P(args) args
+#define __PMT(args) args
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+#if defined(__GNUC__) && !defined(__cplusplus)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+#else
+# define __THROW
+# define __NTH(fct) fct
+#endif