[PATCH 60/73] bsd-headers: Package cdefs.h

Khem Raj
2016-01-17T11:37:52Z

Its used in several packages

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/bsd-headers/bsd-headers.bb | 2 ++
.../bsd-headers/bsd-headers/sys-cdefs.h | 26 ++++++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h

diff --git a/meta/recipes-core/bsd-headers/bsd-headers.bb b/meta/recipes-core/bsd-headers/bsd-headers.bb
index ae659ab..12a2cca 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 0000000..209a623
--- /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
--
2.7.0