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

Fix more missing symbols.

This commit is contained in:
Stefan Seefeld
2017-04-14 13:14:05 -04:00
parent df16e3e55e
commit 3844c4fc5f
2 changed files with 22 additions and 18 deletions

View File

@@ -90,7 +90,7 @@ struct builtin_dtype<T,true> {
};
template <>
struct builtin_dtype<bool,true> {
struct BOOST_NUMPY_DECL builtin_dtype<bool,true> {
static dtype get();
};

View File

@@ -11,29 +11,33 @@
#include <boost/python/numpy/internal.hpp>
#define DTYPE_FROM_CODE(code) \
dtype(python::detail::new_reference(reinterpret_cast<PyObject*>(PyArray_DescrFromType(code))))
dtype(python::detail::new_reference(reinterpret_cast<PyObject*>(PyArray_DescrFromType(code))))
#define BUILTIN_INT_DTYPE(bits) \
template <> struct builtin_int_dtype< bits, false > { \
static dtype get() { return DTYPE_FROM_CODE(NPY_INT ## bits); } \
}; \
template <> struct builtin_int_dtype< bits, true > { \
static dtype get() { return DTYPE_FROM_CODE(NPY_UINT ## bits); } \
}; \
template dtype get_int_dtype< bits, false >(); \
template dtype get_int_dtype< bits, true >()
template <> struct builtin_int_dtype<bits, false> \
{ \
static dtype get() { return DTYPE_FROM_CODE(NPY_INT ## bits);} \
}; \
template <> struct builtin_int_dtype<bits, true> \
{ \
static dtype get() { return DTYPE_FROM_CODE(NPY_UINT ## bits);} \
}; \
template BOOST_NUMPY_DECL dtype get_int_dtype<bits, false>(); \
template BOOST_NUMPY_DECL dtype get_int_dtype<bits, true>()
#define BUILTIN_FLOAT_DTYPE(bits) \
template <> struct builtin_float_dtype< bits > { \
static dtype get() { return DTYPE_FROM_CODE(NPY_FLOAT ## bits); } \
}; \
template dtype get_float_dtype< bits >()
template <> struct builtin_float_dtype<bits> \
{ \
static dtype get() { return DTYPE_FROM_CODE(NPY_FLOAT ## bits);} \
}; \
template BOOST_NUMPY_DECL dtype get_float_dtype<bits>()
#define BUILTIN_COMPLEX_DTYPE(bits) \
template <> struct builtin_complex_dtype< bits > { \
static dtype get() { return DTYPE_FROM_CODE(NPY_COMPLEX ## bits); } \
}; \
template dtype get_complex_dtype< bits >()
template <> struct builtin_complex_dtype<bits> \
{ \
static dtype get() { return DTYPE_FROM_CODE(NPY_COMPLEX ## bits);} \
}; \
template BOOST_NUMPY_DECL dtype get_complex_dtype<bits>()
namespace boost { namespace python { namespace converter {
NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayDescr_Type, numpy::dtype)