mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
Merged 2009 GSoC work from sandbox-branches/bhy/py3k branch back into trunk.
[SVN r56305]
This commit is contained in:
10
test/m2.cpp
10
test/m2.cpp
@@ -13,6 +13,11 @@
|
||||
#include <boost/python/return_value_policy.hpp>
|
||||
#include "simple_type.hpp"
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
# define PyString_FromString PyUnicode_FromString
|
||||
# define PyInt_FromLong PyLong_FromLong
|
||||
#endif
|
||||
|
||||
// Get a simple (by value) from the argument, and return the
|
||||
// string it holds.
|
||||
PyObject* unwrap_simple(simple x)
|
||||
@@ -52,6 +57,11 @@ PyObject* unwrap_int_const_ref(int const& x)
|
||||
return PyInt_FromLong(x);
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
# undef PyString_FromString
|
||||
# undef PyInt_FromLong
|
||||
#endif
|
||||
|
||||
// rewrap<T> extracts a T from the argument, then converts the T back
|
||||
// to a PyObject* and returns it.
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user