2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 05:22:45 +00:00

Worked around MSVC optimizer bug by writing to_python(double) and

to_python(float) out-of-line


[SVN r8113]
This commit is contained in:
Dave Abrahams
2000-11-03 16:08:54 +00:00
parent 82e59c6d5f
commit 6277023215

13
py.cpp
View File

@@ -213,6 +213,19 @@ bool from_python(PyObject* p, py::Type<bool>)
return true;
}
#ifdef PY_MSVC6_OR_EARLIER
// An optimizer bug prevents these from being inlined.
PyObject* to_python(double d)
{
return PyFloat_FromDouble(d);
}
PyObject* to_python(float f)
{
return PyFloat_FromDouble(f);
}
#endif // PY_MSVC6_OR_EARLIER
#ifdef PY_NO_INLINE_FRIENDS_IN_NAMESPACE
namespace py {
#endif