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/boost/patches | |
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/boost/patches')
-rw-r--r-- | meta-pkgs/boost/patches/patch-af | 49 |
1 files changed, 49 insertions, 0 deletions
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); + } + }; + |