diff options
author | jmmv <jmmv@pkgsrc.org> | 2011-10-14 01:12:06 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2011-10-14 01:12:06 +0000 |
commit | 95b45283d6954e9fde067f6a617e98636b547756 (patch) | |
tree | e56370325aabc6a8311b4eeb2f236471bb41c552 /meta-pkgs | |
parent | 846646eec9fa66f4a3a200a8e71b2ad1e6581a72 (diff) | |
download | pkgsrc-95b45283d6954e9fde067f6a617e98636b547756.tar.gz |
Fix build of boost-libs in NetBSD/macppc: 'char' is not signed, so a piece
of code was raising warnings and failing to build. Changed to use 255 for
error conditions instead of -1, along with unsigned chars unconditionally.
Diffstat (limited to 'meta-pkgs')
-rw-r--r-- | meta-pkgs/boost/distinfo | 3 | ||||
-rw-r--r-- | meta-pkgs/boost/patches/patch-af | 49 |
2 files changed, 51 insertions, 1 deletions
diff --git a/meta-pkgs/boost/distinfo b/meta-pkgs/boost/distinfo index 19a07dc0625..6cecd1c84b3 100644 --- a/meta-pkgs/boost/distinfo +++ b/meta-pkgs/boost/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.35 2011/10/11 10:02:08 adam Exp $ +$NetBSD: distinfo,v 1.36 2011/10/14 01:12:06 jmmv Exp $ SHA1 (boost_1_47_0.tar.bz2) = 6e3eb548b9d955c0bc6f71c51042b713b678136a RMD160 (boost_1_47_0.tar.bz2) = 511144eb5ade340115971c372a3c849bd55181f1 @@ -8,6 +8,7 @@ SHA1 (patch-ab) = f1c95ae229465a4d2da76ce6ff88d76ace52fdd8 SHA1 (patch-ac) = 54d40e6a62cdf40c4155c64d9f02df475fbe111d SHA1 (patch-ad) = d36799e40e1f7e6f62768e1144859f22ce76a265 SHA1 (patch-ae) = 2fb49c90bbb3fd797ccdfaaf44c93494a5988f52 +SHA1 (patch-af) = 560157e198b416be700f15fe816e0196134fe414 SHA1 (patch-ag) = b19bf29b0c08ede6470e0a697f99d4ea796ab987 SHA1 (patch-ah) = c32b43bdbbe3cecc15ad56172083ee6ed926b45b SHA1 (patch-aq) = e5c7b72ffa2942ce401f3d9bf05498fd761df17a diff --git a/meta-pkgs/boost/patches/patch-af b/meta-pkgs/boost/patches/patch-af new file mode 100644 index 00000000000..48696babcc0 --- /dev/null +++ b/meta-pkgs/boost/patches/patch-af @@ -0,0 +1,49 @@ +$NetBSD: patch-af,v 1.8 2011/10/14 01:12:06 jmmv Exp $ + +A 'char' cannot be expected to be signed. PowerPC, for example, defines +the 'char' type as unsigned. Fix this piece of code to not deal with +signed characters. + +--- ./boost/archive/iterators/binary_from_base64.hpp.orig 2011-10-13 23:56:25.000000000 +0000 ++++ ./boost/archive/iterators/binary_from_base64.hpp +@@ -39,28 +39,28 @@ template<class CharType> + struct to_6_bit { + typedef CharType result_type; + CharType operator()(CharType t) const{ +- const char lookup_table[] = { +- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, +- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, +- 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, +- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, +- 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, +- -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, +- 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1 ++ unsigned char lookup_table[] = { ++ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, ++ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, ++ 255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63, ++ 52,53,54,55,56,57,58,59,60,61,255,255,255,255,255,255, ++ 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, ++ 15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255, ++ 255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, ++ 41,42,43,44,45,46,47,48,49,50,51,255,255,255,255,255 + }; + // metrowerks trips this assertion - how come? + #if ! defined(__MWERKS__) + BOOST_STATIC_ASSERT(128 == sizeof(lookup_table)); + #endif +- signed char value = -1; ++ unsigned char value = 255; + if((unsigned)t <= 127) + value = lookup_table[(unsigned)t]; +- if(-1 == value) ++ if(255 == value) + boost::serialization::throw_exception( + dataflow_exception(dataflow_exception::invalid_base64_character) + ); +- return value; ++ return static_cast< CharType >(value); + } + }; + |