summaryrefslogtreecommitdiff
path: root/boost/python/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'boost/python/numpy')
-rw-r--r--boost/python/numpy/config.hpp8
-rw-r--r--boost/python/numpy/dtype.hpp7
-rw-r--r--boost/python/numpy/internal.hpp1
-rw-r--r--boost/python/numpy/ndarray.hpp4
4 files changed, 13 insertions, 7 deletions
diff --git a/boost/python/numpy/config.hpp b/boost/python/numpy/config.hpp
index 6f39d3ce86..97178906e0 100644
--- a/boost/python/numpy/config.hpp
+++ b/boost/python/numpy/config.hpp
@@ -62,7 +62,11 @@
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
-#define BOOST_LIB_NAME boost_numpy
+#if PY_MAJOR_VERSION == 2
+# define BOOST_LIB_NAME boost_numpy
+#elif PY_MAJOR_VERSION == 3
+# define BOOST_LIB_NAME boost_numpy3
+#endif
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
@@ -75,4 +79,6 @@
#include <boost/config/auto_link.hpp>
#endif // auto-linking disabled
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+
#endif // CONFIG_NUMPY20170215_H_
diff --git a/boost/python/numpy/dtype.hpp b/boost/python/numpy/dtype.hpp
index b9e95f9beb..4673745e57 100644
--- a/boost/python/numpy/dtype.hpp
+++ b/boost/python/numpy/dtype.hpp
@@ -13,11 +13,10 @@
*/
#include <boost/python.hpp>
-#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
#include <boost/python/numpy/config.hpp>
-
+#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
#include <boost/mpl/for_each.hpp>
-#include <boost/type_traits/add_pointer.hpp>
+#include <boost/python/detail/type_traits.hpp>
namespace boost { namespace python { namespace numpy {
@@ -90,7 +89,7 @@ struct builtin_dtype<T,true> {
};
template <>
-struct builtin_dtype<bool,true> {
+struct BOOST_NUMPY_DECL builtin_dtype<bool,true> {
static dtype get();
};
diff --git a/boost/python/numpy/internal.hpp b/boost/python/numpy/internal.hpp
index fed31cbb08..c24718f0ae 100644
--- a/boost/python/numpy/internal.hpp
+++ b/boost/python/numpy/internal.hpp
@@ -15,6 +15,7 @@
*/
#include <boost/python.hpp>
+#include <boost/python/numpy/config.hpp>
#ifdef BOOST_PYTHON_NUMPY_INTERNAL
#define NO_IMPORT_ARRAY
#define NO_IMPORT_UFUNC
diff --git a/boost/python/numpy/ndarray.hpp b/boost/python/numpy/ndarray.hpp
index e5b6a9e94b..98a4cb15a1 100644
--- a/boost/python/numpy/ndarray.hpp
+++ b/boost/python/numpy/ndarray.hpp
@@ -13,7 +13,7 @@
#include <boost/python.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_integral.hpp>
+#include <boost/python/detail/type_traits.hpp>
#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
#include <boost/python/numpy/dtype.hpp>
#include <boost/python/numpy/config.hpp>
@@ -176,7 +176,7 @@ ndarray from_data_impl(void * data,
Container strides,
object const & owner,
bool writeable,
- typename boost::enable_if< boost::is_integral<typename Container::value_type> >::type * enabled = NULL)
+ typename boost::enable_if< boost::python::detail::is_integral<typename Container::value_type> >::type * enabled = NULL)
{
std::vector<Py_intptr_t> shape_(shape.begin(),shape.end());
std::vector<Py_intptr_t> strides_(strides.begin(), strides.end());