mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 18:12:43 +00:00
vc7 compatibility for BOost.Python v1
Better error messages for Jam when actions are too long [SVN r13477]
This commit is contained in:
@@ -41,6 +41,9 @@ the following compilers (Note that pickling doesn't work with Python
|
||||
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>. All
|
||||
tests pass.
|
||||
|
||||
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
|
||||
Studio .NET)</a>. All tests pass.
|
||||
|
||||
<li><a href="http://www.metrowerks.com/products/windows/">Metrowerks
|
||||
CodeWarrior Pro7.2 for Windows</a>. All tests pass.
|
||||
|
||||
@@ -62,9 +65,6 @@ the following compilers (Note that pickling doesn't work with Python
|
||||
C++ 5.0</a> Comprehensive test fails at runtime due to an
|
||||
exception-handling bug. Other tests seem to work.
|
||||
|
||||
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
|
||||
Studio .NET)</a>. Some tests fail to compile (comprehensive.cpp,
|
||||
ivect.cpp, dvect.cpp, noncopyable_export.cpp); others seem to work.
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ unsigned char from_python(PyObject*, boost::python::type<const unsigned char&>);
|
||||
BOOST_PYTHON_DECL float from_python(PyObject*, boost::python::type<float>);
|
||||
BOOST_PYTHON_DECL double from_python(PyObject*, boost::python::type<double>);
|
||||
|
||||
# ifndef BOOST_MSVC6_OR_EARLIER
|
||||
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
|
||||
PyObject* to_python(float);
|
||||
PyObject* to_python(double);
|
||||
# else
|
||||
@@ -260,7 +260,7 @@ PyObject* from_python(PyObject*, boost::python::type<PyObject*>);
|
||||
// #endif
|
||||
// }} // namespace boost::python
|
||||
|
||||
#if !defined(BOOST_MSVC6_OR_EARLIER)
|
||||
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
||||
template <class T>
|
||||
boost::shared_ptr<T> from_python(PyObject*p, boost::python::type<boost::shared_ptr<T> >)
|
||||
{
|
||||
@@ -286,7 +286,7 @@ PyObject* to_python(boost::shared_ptr<T> p)
|
||||
// inline implementations
|
||||
//
|
||||
|
||||
#ifndef BOOST_MSVC6_OR_EARLIER
|
||||
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
|
||||
inline PyObject* to_python(double d)
|
||||
{
|
||||
return PyFloat_FromDouble(d);
|
||||
@@ -296,7 +296,7 @@ inline PyObject* to_python(float f)
|
||||
{
|
||||
return PyFloat_FromDouble(f);
|
||||
}
|
||||
#endif // BOOST_MSVC6_OR_EARLIER
|
||||
#endif
|
||||
|
||||
inline PyObject* to_python(long l)
|
||||
{
|
||||
|
||||
@@ -206,7 +206,7 @@ BOOST_PYTHON_DECL bool from_python(PyObject* p, boost::python::type<bool>)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC6_OR_EARLIER
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||
// An optimizer bug prevents these from being inlined.
|
||||
BOOST_PYTHON_DECL PyObject* to_python(double d)
|
||||
{
|
||||
@@ -217,7 +217,7 @@ BOOST_PYTHON_DECL PyObject* to_python(float f)
|
||||
{
|
||||
return PyFloat_FromDouble(f);
|
||||
}
|
||||
#endif // BOOST_MSVC6_OR_EARLIER
|
||||
#endif
|
||||
|
||||
BOOST_PYTHON_END_CONVERSION_NAMESPACE
|
||||
|
||||
|
||||
@@ -103,7 +103,14 @@ StringMapPythonClass::StringMapPythonClass(boost::python::module_builder& m)
|
||||
: boost::python::class_builder<StringMap >(m, "StringMap")
|
||||
{
|
||||
def(boost::python::constructor<>());
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC == 1300
|
||||
// MSVC7 incorrectly makes this the target of this function
|
||||
// pointer the same type as the class in which it is defined (some
|
||||
// standard library class), instead of StringMap.
|
||||
def((std::size_t (StringMap::*)()const)&StringMap::size, "__len__");
|
||||
#else
|
||||
def(&StringMap::size, "__len__");
|
||||
#endif
|
||||
def(&get_item, "__getitem__");
|
||||
def(&set_item, "__setitem__");
|
||||
def(&del_item, "__delitem__");
|
||||
@@ -884,7 +891,7 @@ namespace bpl_test {
|
||||
// This doesn't test anything but the compiler, since it has the same signature as the above.
|
||||
// Since MSVC is broken and gets the signature wrong, we'll skip it.
|
||||
std::string use_const_plain_char(
|
||||
#ifndef BOOST_MSVC6_OR_EARLIER
|
||||
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
|
||||
const
|
||||
#endif
|
||||
char c) { return std::string(5, c); }
|
||||
|
||||
Reference in New Issue
Block a user