From 307e07f0f57287d1f66aae25a71593702628d780 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 29 Sep 2009 04:35:16 +0000 Subject: [PATCH 1/6] Initialize branch F-12 for boost --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..06de2d2 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-12 From f9489232b3b066cb75de3538244f5eea0d4bf0e1 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 14 Oct 2009 12:24:34 +0000 Subject: [PATCH 2/6] - Several fixes to support PySide - Resolves: #520087 - GCC 4.4 name resolution fixes for GIL - Resolves: #526834 --- boost-gil_gcc44.patch | 204 +++++++++++++++++++++++++++++++ boost-python_call_operator.patch | 160 ++++++++++++++++++++++++ boost-python_enums.patch | 136 +++++++++++++++++++++ boost-python_uint.patch | 106 ++++++++++++++++ boost.spec | 16 ++- 5 files changed, 621 insertions(+), 1 deletion(-) create mode 100644 boost-gil_gcc44.patch create mode 100644 boost-python_call_operator.patch create mode 100644 boost-python_enums.patch create mode 100644 boost-python_uint.patch diff --git a/boost-gil_gcc44.patch b/boost-gil_gcc44.patch new file mode 100644 index 0000000..e0f86b7 --- /dev/null +++ b/boost-gil_gcc44.patch @@ -0,0 +1,204 @@ +Index: boost/gil/bit_aligned_pixel_reference.hpp +=================================================================== +--- boost/gil/bit_aligned_pixel_reference.hpp (revision 53049) ++++ boost/gil/bit_aligned_pixel_reference.hpp (working copy) +@@ -145,7 +145,7 @@ + + // Construct from another compatible pixel type + bit_aligned_pixel_reference(const bit_aligned_pixel_reference& p) : _bit_range(p._bit_range) {} +- template bit_aligned_pixel_reference(packed_pixel& p) : _bit_range(static_cast(&at_c<0>(p)), at_c<0>(p).first_bit()) { ++ template bit_aligned_pixel_reference(packed_pixel& p) : _bit_range(static_cast(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit()) { + check_compatible >(); + } + +Index: boost/gil/color_base.hpp +=================================================================== +--- boost/gil/color_base.hpp (revision 53049) ++++ boost/gil/color_base.hpp (working copy) +@@ -155,15 +155,15 @@ + homogeneous_color_base(Element v0, Element v1, Element v2) : _v0(v0), _v1(v1), _v2(v2) {} + + template homogeneous_color_base(const homogeneous_color_base& c) : +- _v0(at_c::value>(c)), +- _v1(at_c::value>(c)), +- _v2(at_c::value>(c)) {} ++ _v0(gil::at_c::value>(c)), ++ _v1(gil::at_c::value>(c)), ++ _v2(gil::at_c::value>(c)) {} + + // Support for l-value reference proxy copy construction + template homogeneous_color_base( homogeneous_color_base& c) : +- _v0(at_c::value>(c)), +- _v1(at_c::value>(c)), +- _v2(at_c::value>(c)) {} ++ _v0(gil::at_c::value>(c)), ++ _v1(gil::at_c::value>(c)), ++ _v2(gil::at_c::value>(c)) {} + + // Support for planar_pixel_iterator construction and dereferencing + template homogeneous_color_base(P* p,bool) : +Index: boost/gil/color_base_algorithm.hpp +=================================================================== +--- boost/gil/color_base_algorithm.hpp (revision 53049) ++++ boost/gil/color_base_algorithm.hpp (working copy) +@@ -101,7 +101,7 @@ + template struct kth_semantic_element_reference_type { + BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c::type::value)); + typedef typename kth_element_reference_type::type type; +- static type get(ColorBase& cb) { return at_c(cb); } ++ static type get(ColorBase& cb) { return gil::at_c(cb); } + }; + + /// \brief Specifies the return type of the constant semantic_at_c(color_base); +@@ -109,7 +109,7 @@ + template struct kth_semantic_element_const_reference_type { + BOOST_STATIC_CONSTANT(int, semantic_index = (mpl::at_c::type::value)); + typedef typename kth_element_const_reference_type::type type; +- static type get(const ColorBase& cb) { return at_c(cb); } ++ static type get(const ColorBase& cb) { return gil::at_c(cb); } + }; + + /// \brief A mutable accessor to the K-th semantic element of a color base +Index: boost/gil/image_view_factory.hpp +=================================================================== +--- boost/gil/image_view_factory.hpp (revision 53049) ++++ boost/gil/image_view_factory.hpp (working copy) +@@ -102,7 +102,7 @@ + BOOST_STATIC_ASSERT((!is_planar::value && view_is_basic::value)); + BOOST_STATIC_ASSERT((boost::is_pointer::value)); + +- return &at_c<0>(view(0,0)); ++ return &gil::at_c<0>(view(0,0)); + } + + /// \ingroup ImageViewConstructors +@@ -430,7 +430,7 @@ + typedef typename type::xy_locator locator_t; + typedef typename type::x_iterator x_iterator_t; + typedef typename iterator_adaptor_get_base::type x_iterator_base_t; +- x_iterator_t sit(x_iterator_base_t(&at_c(src(0,0))),src.pixels().pixel_size()); ++ x_iterator_t sit(x_iterator_base_t(&gil::at_c(src(0,0))),src.pixels().pixel_size()); + return type(src.dimensions(),locator_t(sit, src.pixels().row_size())); + } + }; +@@ -444,7 +444,7 @@ + typedef typename view_type::value>::type type; + static type make(const View& src) { + typedef typename type::x_iterator x_iterator_t; +- return interleaved_view(src.width(),src.height(),(x_iterator_t)&at_c(src(0,0)), src.pixels().row_size()); ++ return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c(src(0,0)), src.pixels().row_size()); + } + }; + +@@ -494,7 +494,7 @@ + template kth_channel_deref_fn(const kth_channel_deref_fn&) {} + + result_type operator()(argument_type srcP) const { +- return result_type(at_c(srcP)); ++ return result_type(gil::at_c(srcP)); + } + }; + +Index: boost/gil/packed_pixel.hpp +=================================================================== +--- boost/gil/packed_pixel.hpp (revision 53049) ++++ boost/gil/packed_pixel.hpp (working copy) +@@ -81,7 +81,7 @@ + } + packed_pixel(int chan0, int chan1, int chan2) : _bitfield(0) { + BOOST_STATIC_ASSERT((num_channels::value==3)); +- at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; ++ gil::at_c<0>(*this)=chan0; gil::at_c<1>(*this)=chan1; gil::at_c<2>(*this)=chan2; + } + packed_pixel(int chan0, int chan1, int chan2, int chan3) : _bitfield(0) { + BOOST_STATIC_ASSERT((num_channels::value==4)); +Index: boost/gil/pixel.hpp +=================================================================== +--- boost/gil/pixel.hpp (revision 53049) ++++ boost/gil/pixel.hpp (working copy) +@@ -143,11 +143,11 @@ + + private: + static void check_gray() { BOOST_STATIC_ASSERT((is_same::value)); } +- template void assign(const Channel& chan, mpl::false_) { check_gray(); at_c<0>(*this)=chan; } +- template bool equal (const Channel& chan, mpl::false_) const { check_gray(); return at_c<0>(*this)==chan; } ++ template void assign(const Channel& chan, mpl::false_) { check_gray(); gil::at_c<0>(*this)=chan; } ++ template bool equal (const Channel& chan, mpl::false_) const { check_gray(); return gil::at_c<0>(*this)==chan; } + public: +- pixel& operator= (channel_t chan) { check_gray(); at_c<0>(*this)=chan; return *this; } +- bool operator==(channel_t chan) const { check_gray(); return at_c<0>(*this)==chan; } ++ pixel& operator= (channel_t chan) { check_gray(); gil::at_c<0>(*this)=chan; return *this; } ++ bool operator==(channel_t chan) const { check_gray(); return gil::at_c<0>(*this)==chan; } + }; + + ///////////////////////////// +Index: boost/gil/planar_pixel_iterator.hpp +=================================================================== +--- boost/gil/planar_pixel_iterator.hpp (revision 53049) ++++ boost/gil/planar_pixel_iterator.hpp (working copy) +@@ -109,8 +109,8 @@ + reference operator->() const { return **this; } + + // PERFORMANCE_CHECK: Remove? +- bool operator< (const planar_pixel_iterator& ptr) const { return at_c<0>(*this)< at_c<0>(ptr); } +- bool operator!=(const planar_pixel_iterator& ptr) const { return at_c<0>(*this)!=at_c<0>(ptr); } ++ bool operator< (const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)< gil::at_c<0>(ptr); } ++ bool operator!=(const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)!=gil::at_c<0>(ptr); } + private: + friend class boost::iterator_core_access; + +@@ -119,8 +119,8 @@ + void advance(ptrdiff_t d) { static_transform(*this,*this,std::bind2nd(detail::plus_asymmetric(),d)); } + reference dereference() const { return this->template deref(); } + +- ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return at_c<0>(it)-at_c<0>(*this); } +- bool equal(const planar_pixel_iterator& it) const { return at_c<0>(*this)==at_c<0>(it); } ++ ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); } ++ bool equal(const planar_pixel_iterator& it) const { return gil::at_c<0>(*this)==gil::at_c<0>(it); } + }; + + namespace detail { +Index: libs/gil/test/pixel.cpp +=================================================================== +--- libs/gil/test/pixel.cpp (revision 53049) ++++ libs/gil/test/pixel.cpp (working copy) +@@ -34,8 +34,9 @@ + // Testing pixel references and values, pixel operations, color conversion + + using namespace boost::gil; +-using namespace std; ++using std::swap; + using namespace boost; ++ + void error_if(bool condition); + + struct increment { +@@ -63,8 +64,8 @@ + + // test homogeneous algorithms - fill, max, min + static const int num_chan = num_channels::value; +- static_fill(C2::_pixel, at_c<0>(C1::_pixel)+1); +- error_if(at_c<0>(C2::_pixel) != at_c(C2::_pixel)); ++ static_fill(C2::_pixel, gil::at_c<0>(C1::_pixel)+1); ++ error_if(gil::at_c<0>(C2::_pixel) != gil::at_c(C2::_pixel)); + + C2::_pixel = C1::_pixel; + error_if(static_max(C2::_pixel) != static_max(C1::_pixel)); +@@ -107,7 +108,7 @@ + error_if(C1::_pixel!=C2::_pixel); + + static_generate(C2::_pixel, set_to_one()); +- error_if(at_c<0>(C2::_pixel) != 1); ++ error_if(gil::at_c<0>(C2::_pixel) != 1); + + // Test swap if both are mutable and if their value type is the same + // (We know the second one is mutable) +@@ -313,7 +314,7 @@ + bgr8_pixel_t bgr8(rgb8); + error_if(bgr8[0] == rgb8[0]); + error_if(dynamic_at_c(bgr8,0) == dynamic_at_c(rgb8,0)); +- error_if(at_c<0>(bgr8) == at_c<0>(rgb8)); ++ error_if(gil::at_c<0>(bgr8) == gil::at_c<0>(rgb8)); + error_if(semantic_at_c<0>(bgr8) != semantic_at_c<0>(rgb8)); + error_if(get_color(bgr8,blue_t()) != get_color(rgb8,blue_t())); + diff --git a/boost-python_call_operator.patch b/boost-python_call_operator.patch new file mode 100644 index 0000000..1a85075 --- /dev/null +++ b/boost-python_call_operator.patch @@ -0,0 +1,160 @@ +Index: /trunk/boost/python/object_core.hpp +=================================================================== +--- /trunk/boost/python/object_core.hpp (revision 45918) ++++ /trunk/boost/python/object_core.hpp (revision 47846) +@@ -42,4 +42,10 @@ + + namespace boost { namespace python { ++ ++namespace detail ++{ ++ class kwds_proxy; ++ class args_proxy; ++} + + namespace converter +@@ -103,4 +109,9 @@ + # define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, )) + # include BOOST_PP_ITERATE() ++ ++ detail::args_proxy operator* () const; ++ object operator()(detail::args_proxy const &args) const; ++ object operator()(detail::args_proxy const &args, ++ detail::kwds_proxy const &kwds) const; + + // truth value testing +@@ -417,4 +428,60 @@ + // + ++namespace detail ++{ ++ ++class call_proxy ++{ ++public: ++ call_proxy(object target) : m_target(target) {} ++ operator object() const { return m_target;} ++ ++ private: ++ object m_target; ++}; ++ ++class kwds_proxy : public call_proxy ++{ ++public: ++ kwds_proxy(object o = object()) : call_proxy(o) {} ++}; ++class args_proxy : public call_proxy ++{ ++public: ++ args_proxy(object o) : call_proxy(o) {} ++ kwds_proxy operator* () const { return kwds_proxy(*this);} ++}; ++} ++ ++template ++detail::args_proxy api::object_operators::operator* () const ++{ ++ object_cref2 x = *static_cast(this); ++ return detail::args_proxy(x); ++} ++ ++template ++object api::object_operators::operator()(detail::args_proxy const &args) const ++{ ++ U const& self = *static_cast(this); ++ PyObject *result = PyObject_Call(get_managed_object(self, tag), ++ args.operator object().ptr(), ++ 0); ++ return object(detail::new_reference(result)); ++ ++} ++ ++template ++object api::object_operators::operator()(detail::args_proxy const &args, ++ detail::kwds_proxy const &kwds) const ++{ ++ U const& self = *static_cast(this); ++ PyObject *result = PyObject_Call(get_managed_object(self, tag), ++ args.operator object().ptr(), ++ kwds.operator object().ptr()); ++ return object(detail::new_reference(result)); ++ ++} ++ + inline object::object() + : object_base(python::incref(Py_None)) +Index: /trunk/libs/python/test/object.cpp +=================================================================== +--- /trunk/libs/python/test/object.cpp (revision 45918) ++++ /trunk/libs/python/test/object.cpp (revision 47846) +@@ -187,4 +187,9 @@ + return s.slice(2,-1).slice(1,-1) == "lo, wor"; + } ++ ++object test_call(object c, object args, object kwds) ++{ ++ return c(*args, **kwds); ++} + + bool check_binary_operators() +@@ -378,4 +383,5 @@ + def("test_not_item", test_not_item); + ++ def("test_call", test_call); + def("check_binary_operators", check_binary_operators); + def("check_inplace", check_inplace); +Index: /trunk/libs/python/test/object.py +=================================================================== +--- /trunk/libs/python/test/object.py (revision 45918) ++++ /trunk/libs/python/test/object.py (revision 47846) +@@ -135,5 +135,10 @@ + Operators + +- ++>>> def print_args(*args, **kwds): ++... print args, kwds ++>>> test_call(print_args, (0, 1, 2, 3), {'a':'A'}) ++(0, 1, 2, 3) {'a': 'A'} ++ ++ + >>> assert check_binary_operators() + +Index: /trunk/libs/python/doc/v2/object.html +=================================================================== +--- /trunk/libs/python/doc/v2/object.html (revision 45918) ++++ /trunk/libs/python/doc/v2/object.html (revision 47846) +@@ -656,4 +656,9 @@ + object operator()(A0 const&, A1 const&,...An const&) const; + ++ detail::args_proxy operator* () const; ++ object operator()(detail::args_proxy const &args) const; ++ object operator()(detail::args_proxy const &args, ++ detail::kwds_proxy const &kwds) const; ++ + // truth value testing + // +@@ -705,4 +710,23 @@ + a2,...aN) + ++ ++
++object operator()(detail::args_proxy const &args) const; 
++
++
++
Effects: ++ call object with arguments given by the tuple args
++
++
++object operator()(detail::args_proxy const &args, 
++                  detail::kwds_proxy const &kwds) const; 
++
++
++
Effects: ++ call object with arguments given by the tuple args, and named ++ arguments given by the dictionary kwds
++
++ ++ +
+ operator bool_type() const;
diff --git a/boost-python_enums.patch b/boost-python_enums.patch
new file mode 100644
index 0000000..639be12
--- /dev/null
+++ b/boost-python_enums.patch
@@ -0,0 +1,136 @@
+Index: /trunk/libs/python/test/enum.py
+===================================================================
+--- /trunk/libs/python/test/enum.py (revision 36256)
++++ /trunk/libs/python/test/enum.py (revision 53660)
+@@ -5,6 +5,6 @@
+ >>> from enum_ext import *
+ 
+->>> identity(color.red)
+-enum_ext.color.red
++>>> identity(color.red) # in case of duplicated enums it always take the last enum
++enum_ext.color.blood
+ 
+ >>> identity(color.green)
+@@ -14,6 +14,6 @@
+ enum_ext.color.blue
+ 
+->>> identity(color(1))
+-enum_ext.color.red
++>>> identity(color(1)) # in case of duplicated enums it always take the last enum
++enum_ext.color.blood
+ 
+ >>> identity(color(2))
+@@ -29,5 +29,5 @@
+ 
+ >>> identity(red)
+-enum_ext.color.red
++enum_ext.color.blood
+ 
+ >>> identity(green)
+@@ -43,8 +43,16 @@
+ >>> c = colorized()
+ >>> c.x
+-enum_ext.color.red
++enum_ext.color.blood
+ >>> c.x = green
+ >>> c.x
+ enum_ext.color.green
++>>> red == blood
++True
++>>> red == green
++False
++>>> hash(red) == hash(blood)
++True
++>>> hash(red) == hash(green)
++False
+ '''
+ 
+Index: /trunk/libs/python/test/enum.cpp
+===================================================================
+--- /trunk/libs/python/test/enum.cpp (revision 24614)
++++ /trunk/libs/python/test/enum.cpp (revision 53660)
+@@ -13,5 +13,5 @@
+ using namespace boost::python;
+ 
+-enum color { red = 1, green = 2, blue = 4 };
++enum color { red = 1, green = 2, blue = 4, blood = 1 };
+ 
+ #if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
+@@ -35,4 +35,5 @@
+         .value("green", green)
+         .value("blue", blue)
++        .value("blood", blood)
+         .export_values()
+         ;
+Index: /trunk/libs/python/src/object/enum.cpp
+===================================================================
+--- /trunk/libs/python/src/object/enum.cpp (revision 41521)
++++ /trunk/libs/python/src/object/enum.cpp (revision 53660)
+@@ -15,5 +15,5 @@
+ #include 
+ 
+-namespace boost { namespace python { namespace objects { 
++namespace boost { namespace python { namespace objects {
+ 
+ struct enum_object
+@@ -44,5 +44,5 @@
+             if (name == 0)
+                 return 0;
+-            
++
+             return PyString_FromFormat("%s.%s.%s", mod, self_->ob_type->tp_name, name);
+         }
+@@ -140,4 +140,5 @@
+       d["__slots__"] = tuple();
+       d["values"] = dict();
++      d["names"] = dict();
+ 
+       object module_name = module_prefix();
+@@ -146,7 +147,7 @@
+       if (doc)
+          d["__doc__"] = doc;
+-      
++
+       object result = (object(metatype))(name, make_tuple(base), d);
+-      
++
+       scope().attr(name) = result;
+ 
+@@ -168,5 +169,5 @@
+         = const_cast(
+             converter::registry::lookup(id));
+-            
++
+     converters.m_class_object = downcast(this->ptr());
+     converter::registry::insert(to_python, id);
+@@ -187,21 +188,22 @@
+     dict d = extract(this->attr("values"))();
+     d[value] = x;
+-    
++
+     // Set the name field in the new enum instanec
+     enum_object* p = downcast(x.ptr());
+     Py_XDECREF(p->name);
+     p->name = incref(name.ptr());
++
++    dict names_dict = extract(this->attr("names"))();
++    names_dict[x.attr("name")] = x;
+ }
+ 
+ void enum_base::export_values()
+ {
+-    dict d = extract(this->attr("values"))();
+-    list values = d.values();
++    dict d = extract(this->attr("names"))();
++    list items = d.items();
+     scope current;
+-    
+-    for (unsigned i = 0, max = len(values); i < max; ++i)
+-    {
+-        api::setattr(current, object(values[i].attr("name")), values[i]);
+-    }
++
++    for (unsigned i = 0, max = len(items); i < max; ++i)
++        api::setattr(current, items[i][0], items[i][1]);
+  }
+ 
diff --git a/boost-python_uint.patch b/boost-python_uint.patch
new file mode 100644
index 0000000..b27be95
--- /dev/null
+++ b/boost-python_uint.patch
@@ -0,0 +1,106 @@
+Index: /trunk/libs/python/test/test_builtin_converters.py
+===================================================================
+--- /trunk/libs/python/test/test_builtin_converters.py (revision 40714)
++++ /trunk/libs/python/test/test_builtin_converters.py (revision 54919)
+@@ -4,4 +4,22 @@
+ r"""
+ >>> from builtin_converters_ext import *
++
++# Use ctypes to get native C type sizes
++>>> from ctypes import sizeof, c_char, c_short, c_int, c_long, c_longlong
++>>> def test_values_signed(t):
++...     base = 2 ** (8 * sizeof(t) - 1)
++...     return [[-base, -1, 1, base - 1], [-base - 1, base]]
++>>> def test_values_unsigned(t):
++...     base = 2 ** (8 * sizeof(t))
++...     return [[1, base - 1], [-1L, -1, base]]
++>>> def should_pass(method, values):
++...     result = map(method, values)
++...     if result != values:
++...         print "Got %s but expected %s" % (result, values)
++>>> def test_overflow(method, values):
++...     for v in values:
++...         try: method(v)
++...         except OverflowError: pass
++...         else: print "OverflowError expected"
+ 
+ # Synthesize idendity functions in case long long not supported
+@@ -63,13 +81,35 @@
+ 
+    show that we have range checking. 
+- 
+->>> try: rewrap_value_unsigned_short(-42)
+-... except OverflowError: pass
+-... else: print 'expected an OverflowError!'
+-
+->>> try: rewrap_value_int(sys.maxint * 2)
+-... except OverflowError: pass
+-... else: print 'expected an OverflowError!'
+-
++
++>>> should_pass(rewrap_value_signed_char, test_values_signed(c_char)[0])
++>>> should_pass(rewrap_value_short, test_values_signed(c_short)[0])
++>>> should_pass(rewrap_value_int, test_values_signed(c_int)[0])
++>>> should_pass(rewrap_value_long, test_values_signed(c_long)[0])
++>>> should_pass(rewrap_value_long_long, test_values_signed(c_longlong)[0])
++
++>>> should_pass(rewrap_value_unsigned_char, test_values_unsigned(c_char)[0])
++>>> should_pass(rewrap_value_unsigned_short, test_values_unsigned(c_short)[0])
++>>> should_pass(rewrap_value_unsigned_int, test_values_unsigned(c_int)[0])
++>>> should_pass(rewrap_value_unsigned_long, test_values_unsigned(c_long)[0])
++>>> should_pass(rewrap_value_unsigned_long_long,
++...     test_values_unsigned(c_longlong)[0])
++
++>>> test_overflow(rewrap_value_signed_char, test_values_signed(c_char)[1])
++>>> test_overflow(rewrap_value_short, test_values_signed(c_short)[1])
++>>> test_overflow(rewrap_value_int, test_values_signed(c_int)[1])
++>>> test_overflow(rewrap_value_long, test_values_signed(c_long)[1])
++>>> test_overflow(rewrap_value_long_long, test_values_signed(c_longlong)[1])
++
++>>> test_overflow(rewrap_value_unsigned_char, test_values_unsigned(c_char)[1])
++>>> test_overflow(rewrap_value_unsigned_short, test_values_unsigned(c_short)[1])
++>>> test_overflow(rewrap_value_unsigned_int, test_values_unsigned(c_int)[1])
++>>> test_overflow(rewrap_value_unsigned_long, test_values_unsigned(c_long)[1])
++
++# Exceptionally for PyLong_AsUnsignedLongLong(), a negative value raises
++# TypeError on Python versions prior to 2.7
++>>> for v in test_values_unsigned(c_longlong)[1]:
++...     try: rewrap_value_unsigned_long_long(v)
++...     except (OverflowError, TypeError): pass
++...     else: print "OverflowError or TypeError expected"
+ 
+ >>> assert abs(rewrap_value_float(4.2) - 4.2) < .000001
+Index: /trunk/libs/python/src/converter/builtin_converters.cpp
+===================================================================
+--- /trunk/libs/python/src/converter/builtin_converters.cpp (revision 52299)
++++ /trunk/libs/python/src/converter/builtin_converters.cpp (revision 54919)
+@@ -156,8 +156,25 @@
+       static T extract(PyObject* intermediate)
+       {
+-          return numeric_cast(
+-              PyLong_Check(intermediate)
+-              ? PyLong_AsUnsignedLong(intermediate)
+-              : PyInt_AS_LONG(intermediate));
++          if (PyLong_Check(intermediate)) {
++              // PyLong_AsUnsignedLong() checks for negative overflow, so no
++              // need to check it here.
++              unsigned long result = PyLong_AsUnsignedLong(intermediate);
++              if (PyErr_Occurred())
++                  throw_error_already_set();
++              return numeric_cast(result);
++          } else {
++              // None of PyInt_AsUnsigned*() functions check for negative
++              // overflow, so use PyInt_AS_LONG instead and check if number is
++              // negative, issuing the exception appropriately.
++              long result = PyInt_AS_LONG(intermediate);
++              if (PyErr_Occurred())
++                  throw_error_already_set();
++              if (result < 0) {
++                  PyErr_SetString(PyExc_OverflowError, "can't convert negative"
++                                  " value to unsigned");
++                  throw_error_already_set();
++              }
++              return numeric_cast(result);
++          }
+       }
+   };
diff --git a/boost.spec b/boost.spec
index 6a0730d..02589e9 100644
--- a/boost.spec
+++ b/boost.spec
@@ -1,7 +1,7 @@
 Name: boost
 Summary: The Boost C++ Libraries
 Version: 1.39.0
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: Boost
 URL: http://www.boost.org/
 Group: System Environment/Libraries
@@ -43,6 +43,10 @@ Patch5: boost-bitset.patch
 Patch6: boost-function_template.patch
 Patch7: boost-fs_gcc44.patch
 Patch8: boost-openssl-1.0.patch
+Patch9: boost-gil_gcc44.patch
+Patch10: boost-python_call_operator.patch
+Patch11: boost-python_enums.patch
+Patch12: boost-python_uint.patch
 
 %bcond_with tests
 %bcond_with docs_generated
@@ -227,6 +231,10 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH3} | %{__patch} -p0 --fuzz=0
 %patch6 -p0
 %patch7 -p0
 %patch8 -p1
+%patch9 -p0
+%patch10 -p2
+%patch11 -p2
+%patch12 -p2
 
 %build
 BOOST_ROOT=`pwd`
@@ -438,6 +446,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.a
 
 %changelog
+* Wed Oct 14 2009 Petr Machata  - 1.39.0-7
+- Several fixes to support PySide
+- Resolves: #520087
+- GCC 4.4 name resolution fixes for GIL
+- Resolves: #526834
+
 * Tue Sep 08 2009 Karsten Hopp  1.39.0-6
 - bump release and rebuild as the package was linked with an old libicu 
   during the mass rebuild on s390x

From c4edba73a03b9befc4071e44a9ca35905bcd9817 Mon Sep 17 00:00:00 2001
From: Petr Machata 
Date: Thu, 15 Oct 2009 13:01:00 +0000
Subject: [PATCH 3/6] - Package index.html in the -doc subpackage - Resolves:
 #529030

---
 boost.spec | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/boost.spec b/boost.spec
index 02589e9..a5073f7 100644
--- a/boost.spec
+++ b/boost.spec
@@ -1,7 +1,7 @@
 Name: boost
 Summary: The Boost C++ Libraries
 Version: 1.39.0
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: Boost
 URL: http://www.boost.org/
 Group: System Environment/Libraries
@@ -344,7 +344,7 @@ cat tmp-doc-directories | while read a; do
     | xargs install -m 644 -p -t $DOCPATH$a
 done
 rm tmp-doc-directories
-install -p -m 644 -t $DOCPATH LICENSE_1_0.txt index.htm
+install -p -m 644 -t $DOCPATH LICENSE_1_0.txt index.htm index.html
 
 # remove scripts used to generate include files
 find $RPM_BUILD_ROOT%{_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec rm {} \;
@@ -446,6 +446,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.a
 
 %changelog
+* Thu Oct 15 2009 Petr Machata  - 1.39.0-8
+- Package index.html in the -doc subpackage
+- Resolves: #529030
+
 * Wed Oct 14 2009 Petr Machata  - 1.39.0-7
 - Several fixes to support PySide
 - Resolves: #520087

From 2fa14209e0a18a4cf67e99ecaf7aefaba4f9296a Mon Sep 17 00:00:00 2001
From: Petr Machata 
Date: Mon, 16 Nov 2009 23:01:16 +0000
Subject: [PATCH 4/6] - translate_exception.hpp misses a include - Resolves:
 #537612

---
 boost-python_translate_exception.patch | 13 +++++++++++++
 boost.spec                             |  8 +++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 boost-python_translate_exception.patch

diff --git a/boost-python_translate_exception.patch b/boost-python_translate_exception.patch
new file mode 100644
index 0000000..e1f6ab0
--- /dev/null
+++ b/boost-python_translate_exception.patch
@@ -0,0 +1,13 @@
+diff -up /home/petr/fedora/boost/F-12/boost_1_39_0/boost/python/detail/translate_exception.hpp\~ /home/petr/fedora/boost/F-12/boost_1_39_0/boost/python/detail/translate_exception.hpp
+--- boost_1_39_0/boost/python/detail/translate_exception.hpp~	2004-08-20 13:10:24.000000000 +0200
++++ boost_1_39_0/boost/python/detail/translate_exception.hpp	2009-11-16 23:30:23.000000000 +0100
+@@ -9,6 +9,7 @@
+ 
+ # include 
+ # include 
++# include 
+ 
+ # include 
+ 
+
+Diff finished.  Mon Nov 16 23:30:41 2009
diff --git a/boost.spec b/boost.spec
index a5073f7..07beac7 100644
--- a/boost.spec
+++ b/boost.spec
@@ -1,7 +1,7 @@
 Name: boost
 Summary: The Boost C++ Libraries
 Version: 1.39.0
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: Boost
 URL: http://www.boost.org/
 Group: System Environment/Libraries
@@ -47,6 +47,7 @@ Patch9: boost-gil_gcc44.patch
 Patch10: boost-python_call_operator.patch
 Patch11: boost-python_enums.patch
 Patch12: boost-python_uint.patch
+Patch13: boost-python_translate_exception.patch
 
 %bcond_with tests
 %bcond_with docs_generated
@@ -235,6 +236,7 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH3} | %{__patch} -p0 --fuzz=0
 %patch10 -p2
 %patch11 -p2
 %patch12 -p2
+%patch13 -p1
 
 %build
 BOOST_ROOT=`pwd`
@@ -446,6 +448,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.a
 
 %changelog
+* Mon Nov 16 2009 Petr Machata  - 1.39.0-9
+- translate_exception.hpp misses a include
+- Resolves: #537612
+
 * Thu Oct 15 2009 Petr Machata  - 1.39.0-8
 - Package index.html in the -doc subpackage
 - Resolves: #529030

From dccffdb039a3180b7ebb0ac067cc400f9b936100 Mon Sep 17 00:00:00 2001
From: Bill Nottingham 
Date: Thu, 26 Nov 2009 01:22:51 +0000
Subject: [PATCH 5/6] Fix typo that causes a failure to update the common
 directory. (releng     #2781)

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8ebb4c7..a239116 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
 # Makefile for source rpm: boost
-# $Id: Makefile,v 1.3 2005/08/19 17:39:58 bkoz Exp $
+# $Id: Makefile,v 1.4 2007/10/15 17:13:04 scop Exp $
 NAME := boost
 SPECFILE = $(firstword $(wildcard *.spec))
 
 define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
 endef
 
 MAKEFILE_COMMON := $(shell $(find-makefile-common))

From e524a4e0976135825e334f4de17abaa19a72f94b Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering 
Date: Wed, 28 Jul 2010 11:12:05 +0000
Subject: [PATCH 6/6] dist-git conversion

---
 .cvsignore => .gitignore |  0
 Makefile                 | 21 ---------------------
 branch                   |  1 -
 import.log               |  2 --
 4 files changed, 24 deletions(-)
 rename .cvsignore => .gitignore (100%)
 delete mode 100644 Makefile
 delete mode 100644 branch
 delete mode 100644 import.log

diff --git a/.cvsignore b/.gitignore
similarity index 100%
rename from .cvsignore
rename to .gitignore
diff --git a/Makefile b/Makefile
deleted file mode 100644
index a239116..0000000
--- a/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile for source rpm: boost
-# $Id: Makefile,v 1.4 2007/10/15 17:13:04 scop Exp $
-NAME := boost
-SPECFILE = $(firstword $(wildcard *.spec))
-
-define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
-endef
-
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
-
-ifeq ($(MAKEFILE_COMMON),)
-# attempt a checkout
-define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
-endef
-
-MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
-endif
-
-include $(MAKEFILE_COMMON)
diff --git a/branch b/branch
deleted file mode 100644
index 06de2d2..0000000
--- a/branch
+++ /dev/null
@@ -1 +0,0 @@
-F-12
diff --git a/import.log b/import.log
deleted file mode 100644
index 3b6338d..0000000
--- a/import.log
+++ /dev/null
@@ -1,2 +0,0 @@
-boost-1_37_0-1_fc10:HEAD:boost-1.37.0-1.fc10.src.rpm:1229535558
-boost-1_39_0-1_fc10:HEAD:boost-1.39.0-1.fc10.src.rpm:1241744899