mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 17:12:22 +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:
13
py.cpp
13
py.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user