From c28f978e6a3c465f19e10402eae70970f4b15f70 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 11 Dec 2015 13:00:07 +0900 Subject: [PATCH] Fix compilation error on armv7hl --- msgpack-1.3.0-arm-char.patch | 25 +++++++++++++++++++++++++ msgpack.spec | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 msgpack-1.3.0-arm-char.patch diff --git a/msgpack-1.3.0-arm-char.patch b/msgpack-1.3.0-arm-char.patch new file mode 100644 index 0000000..f66f3c3 --- /dev/null +++ b/msgpack-1.3.0-arm-char.patch @@ -0,0 +1,25 @@ +Index: msgpack-1.3.0/include/msgpack/adaptor/int.hpp +=================================================================== +--- msgpack-1.3.0.orig/include/msgpack/adaptor/int.hpp ++++ msgpack-1.3.0/include/msgpack/adaptor/int.hpp +@@ -70,13 +70,17 @@ namespace detail { + template <> + struct object_char_sign { + static inline void make(msgpack::object& o, char v) { +- if (v < 0) { ++ // Since char is unsigned on ARM, the condition below ++ // always evaluates to true and causes error if ++ // -Werror=type-limits is enabled. ++ int v2 = v; ++ if (v2 < 0) { + o.type = msgpack::type::NEGATIVE_INTEGER; +- o.via.i64 = v; ++ o.via.i64 = v2; + } + else { + o.type = msgpack::type::POSITIVE_INTEGER; +- o.via.u64 = v; ++ o.via.u64 = v2; + } + } + }; diff --git a/msgpack.spec b/msgpack.spec index bcc908b..194501f 100644 --- a/msgpack.spec +++ b/msgpack.spec @@ -8,6 +8,8 @@ License: Boost URL: http://msgpack.org Source0: https://github.com/msgpack/msgpack-c/releases/download/cpp-%{version}/%{name}-%{version}.tar.gz +Patch0: msgpack-1.3.0-arm-char.patch + # for regenerating configure BuildRequires: libtool # for %%check @@ -31,6 +33,7 @@ Libraries and header files for %{name} %prep %setup -q +%patch0 -p1 -b .arm-char %build