All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libion: Fix musl build
@ 2019-09-14 14:43 Khem Raj
  2019-09-16 16:58 ` Denys Dmytriyenko
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2019-09-14 14:43 UTC (permalink / raw)
  To: meta-ti

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...tead-of-__BEGIN_DECL-__END_DECL-macr.patch | 42 +++++++++++++++++++
 recipes-devtools/ion/libion_git.bb            |  4 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch

diff --git a/recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch b/recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
new file mode 100644
index 00000000..530c869e
--- /dev/null
+++ b/recipes-devtools/ion/libion/0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch
@@ -0,0 +1,42 @@
+From 197e7bf9a20076c6564a860bd2215e8101ee4cad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 14 Sep 2019 07:36:47 -0700
+Subject: [PATCH] Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+for glibc they are defined like below
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/ion/ion.h | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/include/ion/ion.h b/include/ion/ion.h
+index 81ab9cc..e95df4b 100644
+--- a/include/ion/ion.h
++++ b/include/ion/ion.h
+@@ -24,7 +24,9 @@
+ #include <sys/types.h>
+ #include <linux/ion.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ int ion_open();
+ int ion_close(int fd);
+@@ -34,6 +36,8 @@ int ion_free(int fd, int handle_fd);
+ int ion_query_heap_cnt(int fd, int* cnt);
+ int ion_query_get_heaps(int fd, int cnt, void* buffers);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __ION_H */
+-- 
+2.23.0
+
diff --git a/recipes-devtools/ion/libion_git.bb b/recipes-devtools/ion/libion_git.bb
index 7c93ed3f..38ba9bd8 100644
--- a/recipes-devtools/ion/libion_git.bb
+++ b/recipes-devtools/ion/libion_git.bb
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0.0"
 
 BRANCH = "master"
-SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH}"
+SRC_URI = "git://github.com/glneo/libion.git;protocol=git;branch=${BRANCH} \
+           file://0001-Use-extern-C-instead-of-__BEGIN_DECL-__END_DECL-macr.patch \
+"
 SRCREV = "11dad7977ec3ecba37c013da7ec0408c01413000"
 
 S = "${WORKDIR}/git"
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-16 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-14 14:43 [PATCH] libion: Fix musl build Khem Raj
2019-09-16 16:58 ` Denys Dmytriyenko
2019-09-16 17:03   ` Khem Raj
2019-09-16 17:29     ` Andrew F. Davis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.