Skip to content

Commit 471be52

Browse files
author
Ralf W. Grosse-Kunstleve
committed
boost.python: merging from trunk to release (gcc 4.4 -std=c++0x compatibility)
[SVN r57837]
1 parent e485244 commit 471be52

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

src/object/function_doc_signature.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6+
// boost::python::make_tuple below are for gcc 4.4 -std=c++0x compatibility
7+
// (Intel C++ 10 and 11 with -std=c++0x don't need the full qualification).
8+
69
#include <boost/python/converter/registrations.hpp>
710
#include <boost/python/object/function_doc_signature.hpp>
811
#include <boost/python/errors.hpp>
@@ -12,7 +15,6 @@
1215

1316
#include <boost/python/detail/signature.hpp>
1417

15-
1618
#include <vector>
1719

1820
namespace boost { namespace python { namespace objects {
@@ -228,7 +230,7 @@ namespace boost { namespace python { namespace objects {
228230
{
229231
return str(
230232
"%s %s(%s%s%s%s)"
231-
% make_tuple
233+
% boost::python::make_tuple // workaround, see top
232234
( ret_type
233235
, f->m_name
234236
, str(",").join(formal_params.slice(0,arity-n_overloads))
@@ -239,7 +241,7 @@ namespace boost { namespace python { namespace objects {
239241
}else{
240242
return str(
241243
"%s(%s%s%s%s) -> %s"
242-
% make_tuple
244+
% boost::python::make_tuple // workaround, see top
243245
( f->m_name
244246
, str(",").join(formal_params.slice(0,arity-n_overloads))
245247
, n_overloads ? (n_overloads!=arity?str(" [,"):str("[ ")) : str()
@@ -251,7 +253,7 @@ namespace boost { namespace python { namespace objects {
251253

252254
return str(
253255
"%s %s(%s%s%s%s) %s"
254-
% make_tuple
256+
% boost::python::make_tuple // workaround, see top
255257
( cpp_types?ret_type:str("")
256258
, f->m_name
257259
, str(",").join(formal_params.slice(0,arity-n_overloads))

test/pickle1.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ namespace boost_python_test {
4040
boost::python::tuple
4141
getinitargs(const world& w)
4242
{
43-
using namespace boost::python;
44-
return make_tuple(w.get_country());
43+
return boost::python::make_tuple(w.get_country());
4544
}
4645
};
4746

test/pickle2.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,14 @@ namespace boost_python_test {
5252
boost::python::tuple
5353
getinitargs(const world& w)
5454
{
55-
using namespace boost::python;
56-
return make_tuple(w.get_country());
55+
return boost::python::make_tuple(w.get_country());
5756
}
5857

5958
static
6059
boost::python::tuple
6160
getstate(const world& w)
6261
{
63-
using namespace boost::python;
64-
return make_tuple(w.get_secret_number());
62+
return boost::python::make_tuple(w.get_secret_number());
6563
}
6664

6765
static
@@ -77,7 +75,7 @@ namespace boost_python_test {
7775
);
7876
throw_error_already_set();
7977
}
80-
78+
8179
long number = extract<long>(state[0]);
8280
if (number != 42)
8381
w.set_secret_number(number);

test/pickle3.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#include <boost/python/extract.hpp>
2626
#include <boost/python/back_reference.hpp>
2727

28-
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
29-
# define make_tuple boost::python::make_tuple
30-
#endif
31-
3228
namespace boost_python_test {
3329

3430
// A friendly class.
@@ -53,18 +49,18 @@ namespace boost_python_test {
5349
boost::python::tuple
5450
getinitargs(const world& w)
5551
{
56-
using namespace boost::python;
57-
return make_tuple(w.get_country());
52+
return boost::python::make_tuple(w.get_country());
5853
}
5954

6055
static
6156
boost::python::tuple
6257
getstate(boost::python::object w_obj)
6358
{
64-
using namespace boost::python;
65-
world const& w = extract<world const&>(w_obj)();
59+
world const& w = boost::python::extract<world const&>(w_obj)();
6660

67-
return make_tuple(w_obj.attr("__dict__"), w.get_secret_number());
61+
return boost::python::make_tuple(
62+
w_obj.attr("__dict__"),
63+
w.get_secret_number());
6864
}
6965

7066
static
@@ -73,7 +69,7 @@ namespace boost_python_test {
7369
{
7470
using namespace boost::python;
7571
world& w = extract<world&>(w_obj)();
76-
72+
7773
if (len(state) != 2)
7874
{
7975
PyErr_SetObject(PyExc_ValueError,
@@ -82,11 +78,11 @@ namespace boost_python_test {
8278
);
8379
throw_error_already_set();
8480
}
85-
81+
8682
// restore the object's __dict__
8783
dict d = extract<dict>(w_obj.attr("__dict__"))();
8884
d.update(state[0]);
89-
85+
9086
// restore the internal state of the C++ object
9187
long number = extract<long>(state[1]);
9288
if (number != 42)

0 commit comments

Comments
 (0)