Skip to content

Commit e4b1377

Browse files
committed
vc7 compatibility for BOost.Python v1
Better error messages for Jam when actions are too long [SVN r13477]
1 parent fc5e0fb commit e4b1377

4 files changed

Lines changed: 17 additions & 10 deletions

File tree

doc/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ <h2>Supported Platforms</h2>
4141
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>. All
4242
tests pass.
4343

44+
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
45+
Studio .NET)</a>. All tests pass.
46+
4447
<li><a href="http://www.metrowerks.com/products/windows/">Metrowerks
4548
CodeWarrior Pro7.2 for Windows</a>. All tests pass.
4649

@@ -62,9 +65,6 @@ <h2>Supported Platforms</h2>
6265
C++ 5.0</a> Comprehensive test fails at runtime due to an
6366
exception-handling bug. Other tests seem to work.
6467

65-
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
66-
Studio .NET)</a>. Some tests fail to compile (comprehensive.cpp,
67-
ivect.cpp, dvect.cpp, noncopyable_export.cpp); others seem to work.
6868
</ul>
6969

7070

include/boost/python/conversions.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ unsigned char from_python(PyObject*, boost::python::type<const unsigned char&>);
160160
BOOST_PYTHON_DECL float from_python(PyObject*, boost::python::type<float>);
161161
BOOST_PYTHON_DECL double from_python(PyObject*, boost::python::type<double>);
162162

163-
# ifndef BOOST_MSVC6_OR_EARLIER
163+
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
164164
PyObject* to_python(float);
165165
PyObject* to_python(double);
166166
# else
@@ -260,7 +260,7 @@ PyObject* from_python(PyObject*, boost::python::type<PyObject*>);
260260
// #endif
261261
// }} // namespace boost::python
262262

263-
#if !defined(BOOST_MSVC6_OR_EARLIER)
263+
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
264264
template <class T>
265265
boost::shared_ptr<T> from_python(PyObject*p, boost::python::type<boost::shared_ptr<T> >)
266266
{
@@ -286,7 +286,7 @@ PyObject* to_python(boost::shared_ptr<T> p)
286286
// inline implementations
287287
//
288288

289-
#ifndef BOOST_MSVC6_OR_EARLIER
289+
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
290290
inline PyObject* to_python(double d)
291291
{
292292
return PyFloat_FromDouble(d);
@@ -296,7 +296,7 @@ inline PyObject* to_python(float f)
296296
{
297297
return PyFloat_FromDouble(f);
298298
}
299-
#endif // BOOST_MSVC6_OR_EARLIER
299+
#endif
300300

301301
inline PyObject* to_python(long l)
302302
{

src/conversions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ BOOST_PYTHON_DECL bool from_python(PyObject* p, boost::python::type<bool>)
206206
return true;
207207
}
208208

209-
#ifdef BOOST_MSVC6_OR_EARLIER
209+
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
210210
// An optimizer bug prevents these from being inlined.
211211
BOOST_PYTHON_DECL PyObject* to_python(double d)
212212
{
@@ -217,7 +217,7 @@ BOOST_PYTHON_DECL PyObject* to_python(float f)
217217
{
218218
return PyFloat_FromDouble(f);
219219
}
220-
#endif // BOOST_MSVC6_OR_EARLIER
220+
#endif
221221

222222
BOOST_PYTHON_END_CONVERSION_NAMESPACE
223223

test/comprehensive.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ StringMapPythonClass::StringMapPythonClass(boost::python::module_builder& m)
103103
: boost::python::class_builder<StringMap >(m, "StringMap")
104104
{
105105
def(boost::python::constructor<>());
106+
#if defined(BOOST_MSVC) && BOOST_MSVC == 1300
107+
// MSVC7 incorrectly makes this the target of this function
108+
// pointer the same type as the class in which it is defined (some
109+
// standard library class), instead of StringMap.
110+
def((std::size_t (StringMap::*)()const)&StringMap::size, "__len__");
111+
#else
106112
def(&StringMap::size, "__len__");
113+
#endif
107114
def(&get_item, "__getitem__");
108115
def(&set_item, "__setitem__");
109116
def(&del_item, "__delitem__");
@@ -884,7 +891,7 @@ namespace bpl_test {
884891
// This doesn't test anything but the compiler, since it has the same signature as the above.
885892
// Since MSVC is broken and gets the signature wrong, we'll skip it.
886893
std::string use_const_plain_char(
887-
#ifndef BOOST_MSVC6_OR_EARLIER
894+
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
888895
const
889896
#endif
890897
char c) { return std::string(5, c); }

0 commit comments

Comments
 (0)