diff mbox series

mtools: Fix build with clang

Message ID 20180915081154.28018-1-raj.khem@gmail.com
State Superseded
Headers show
Series mtools: Fix build with clang | expand

Commit Message

Khem Raj Sept. 15, 2018, 8:11 a.m. UTC
Identify with __clang__ to undefine UNUSED

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../mtools/mtools/clang_UNUSED.patch            | 17 +++++++++++++++++
 meta/recipes-devtools/mtools/mtools_4.0.18.bb   |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 meta/recipes-devtools/mtools/mtools/clang_UNUSED.patch

-- 
2.19.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/mtools/mtools/clang_UNUSED.patch b/meta/recipes-devtools/mtools/mtools/clang_UNUSED.patch
new file mode 100644
index 0000000000..6bb9d6a3da
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/clang_UNUSED.patch
@@ -0,0 +1,17 @@ 
+Undefine UNUSED macros with clang
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: mtools-4.0.18/sysincludes.h
+===================================================================
+--- mtools-4.0.18.orig/sysincludes.h
++++ mtools-4.0.18/sysincludes.h
+@@ -101,7 +101,7 @@ typedef void *caddr_t;
+ #if defined __GNUC__ && defined __STDC__
+ /* gcc -traditional doesn't have PACKED, UNUSED and NORETURN */
+ # define PACKED __attribute__ ((packed))
+-# if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3
++# if (__GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3) && !defined(__clang__)
+ /* gcc 2.6.3 doesn't have "unused" */		/* mool */
+ #  define UNUSED(x) x __attribute__ ((unused));x
+ #  define UNUSEDP __attribute__ ((unused))
diff --git a/meta/recipes-devtools/mtools/mtools_4.0.18.bb b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
index 91f7b7c610..3c31aca3ad 100644
--- a/meta/recipes-devtools/mtools/mtools_4.0.18.bb
+++ b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -32,6 +32,7 @@  SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
            file://no-x11.gplv3.patch \
            file://0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch \
            file://0001-remove-LOCK_NB-to-use-blocking-request.patch \
+           file://clang_UNUSED.patch \
            "
 
 SRC_URI_append_class-native = " file://disable-hardcoded-configs.patch"