pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/meta-pkgs/boost Fix build of boost-libs in NetBSD/macp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/25073509b88f
branches:  trunk
changeset: 593792:25073509b88f
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Fri Oct 14 01:12:06 2011 +0000

description:
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:

 meta-pkgs/boost/distinfo         |   3 +-
 meta-pkgs/boost/patches/patch-af |  49 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletions(-)

diffs (70 lines):

diff -r 35c49b45a490 -r 25073509b88f meta-pkgs/boost/distinfo
--- a/meta-pkgs/boost/distinfo  Fri Oct 14 01:05:58 2011 +0000
+++ b/meta-pkgs/boost/distinfo  Fri Oct 14 01:12:06 2011 +0000
@@ -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-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 -r 35c49b45a490 -r 25073509b88f meta-pkgs/boost/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/meta-pkgs/boost/patches/patch-af  Fri Oct 14 01:12:06 2011 +0000
@@ -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);
+     }
+ };
+ 



Home | Main Index | Thread Index | Old Index