Skip to content

Commit f5421ca

Browse files
committed
Default to Python 2.4 in Unix builds
Applied contributed patches http://tinyurl.com/ndljr and http://tinyurl.com/18r [SVN r35138]
1 parent eea7697 commit f5421ca

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

doc/v2/operators.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ <h4><a name="self_t-spec-synopsis"></a>Class <code>self_ns::self_t</code>
214214
<a href=
215215
"#operator_-spec">operator_</a>&lt;<i>unspecified</i>&gt; str(self_t);
216216

217+
<a href=
218+
"#operator_-spec">operator_</a>&lt;<i>unspecified</i>&gt; repr(self_t);
219+
217220
}}};
218221
</pre>
219222
The tables below describe the methods generated when the results of the
@@ -765,6 +768,15 @@ <h4><a name="self_t-spec-value-ops"></a>Class <code>self_t</code> value
765768
<td><code><a href=
766769
"../../../conversion/lexical_cast.htm#lexical_cast">lexical_cast</a>&lt;std::string&gt;(x)</code></td>
767770
</tr>
771+
772+
<tr>
773+
<td><code>repr</code></td>
774+
775+
<td><code>__repr__</code></td>
776+
777+
<td><code><a href=
778+
"../../../conversion/lexical_cast.htm#lexical_cast">lexical_cast</a>&lt;std::string&gt;(x)</code></td>
779+
</tr>
768780
</table>
769781

770782
<h3><a name="other-spec"></a>Class Template <code>other</code></h3>

include/boost/python/converter/registrations.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct BOOST_PYTHON_DECL registration
3434
{
3535
public: // member functions
3636
explicit registration(type_info target, bool is_shared_ptr = false);
37+
~registration();
3738

3839
// Convert the appropriately-typed data to Python
3940
PyObject* to_python(void const volatile*) const;

include/boost/python/object/pointer_holder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void* pointer_holder_back_reference<Pointer, Value>::holds(type_info dst_t, bool
179179
BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil)
180180
))
181181
{
182-
python::detail::initialize_wrapper(self, &*this->m_p);
182+
python::detail::initialize_wrapper(self, get_pointer(this->m_p));
183183
}
184184

185185
# undef N

include/boost/python/operators.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_)
339339
BOOST_PYTHON_UNARY_OPERATOR(float, double, float_)
340340
BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex<double>, complex_)
341341
BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast<std::string>, str)
342+
BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast<std::string>, repr)
342343
# undef BOOST_PYTHON_UNARY_OPERATOR
343344

344345
}} // namespace boost::python
@@ -350,6 +351,7 @@ using boost::python::self_ns::long_;
350351
using boost::python::self_ns::float_;
351352
using boost::python::self_ns::complex_;
352353
using boost::python::self_ns::str;
354+
using boost::python::self_ns::repr;
353355
using boost::python::self_ns::pow;
354356
# endif
355357

src/converter/registry.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source)
5757
: this->m_to_python(const_cast<void*>(source));
5858
}
5959

60+
namespace
61+
{
62+
template< typename T >
63+
void delete_node( T* node )
64+
{
65+
if( !!node && !!node->next )
66+
delete_node( node->next );
67+
delete node;
68+
}
69+
}
70+
71+
registration::~registration()
72+
{
73+
delete_node(lvalue_chain);
74+
delete_node(rvalue_chain);
75+
}
76+
77+
6078
namespace // <unnamed>
6179
{
6280
typedef registration entry;

0 commit comments

Comments
 (0)