2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

GCC-2.95.2 workarounds

[SVN r16620]
This commit is contained in:
Dave Abrahams
2002-12-16 04:01:50 +00:00
parent 48f9bee21e
commit 0d2cdbbdfe

View File

@@ -10,7 +10,7 @@
# include <boost/python/handle.hpp>
# include <string>
# include <complex>
# include <limits>
# include <boost/limits.hpp>
// Since all we can use to decide how to convert an object to_python
// is its C++ type, there can be only one such converter for each
@@ -81,11 +81,13 @@ namespace detail
BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr)
// Specialize converters for signed and unsigned T to Python Int
# define BOOST_PYTHON_TO_INT(T) \
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, PyInt_FromLong(x)) \
BOOST_PYTHON_TO_PYTHON_BY_VALUE( \
unsigned T, static_cast<unsigned long>(x) > std::numeric_limits<long>::max() \
? PyLong_FromUnsignedLong(x) \
# define BOOST_PYTHON_TO_INT(T) \
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, PyInt_FromLong(x)) \
BOOST_PYTHON_TO_PYTHON_BY_VALUE( \
unsigned T \
, static_cast<unsigned long>(x) > static_cast<unsigned long>( \
std::numeric_limits<long>::max()) \
? PyLong_FromUnsignedLong(x) \
: PyInt_FromLong(x))
// Bool is not signed.