From edd890bd2bdb89ac0d9fbcf5b6ba1dcc0bb66717 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Mon, 20 Mar 2017 08:29:15 -0400 Subject: [PATCH] More dllexport fixes --- include/boost/python/converter/pyobject_type.hpp | 7 +++++-- include/boost/python/numpy/dtype.hpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/boost/python/converter/pyobject_type.hpp b/include/boost/python/converter/pyobject_type.hpp index 526f9f9d..bde39e80 100644 --- a/include/boost/python/converter/pyobject_type.hpp +++ b/include/boost/python/converter/pyobject_type.hpp @@ -9,8 +9,11 @@ namespace boost { namespace python { namespace converter { -BOOST_PYTHON_DECL PyObject* checked_downcast_impl(PyObject*, PyTypeObject*); - +BOOST_PYTHON_DECL inline +PyObject* checked_downcast_impl(PyObject *obj, PyTypeObject *type) +{ + return (PyType_IsSubtype(Py_TYPE(obj), type) ? obj : NULL); +} // Used as a base class for specializations which need to provide // Python type checking capability. template diff --git a/include/boost/python/numpy/dtype.hpp b/include/boost/python/numpy/dtype.hpp index 9633d37d..b9e95f9b 100644 --- a/include/boost/python/numpy/dtype.hpp +++ b/include/boost/python/numpy/dtype.hpp @@ -56,7 +56,7 @@ public: * This is more permissive than equality tests. For instance, if long and int are the same * size, the dtypes corresponding to each will be equivalent, but not equal. */ - friend bool equivalent(dtype const & a, dtype const & b); + friend BOOST_NUMPY_DECL bool equivalent(dtype const & a, dtype const & b); /** * @brief Register from-Python converters for NumPy's built-in array scalar types.