diff --git a/include/boost/python/numpy/dtype.hpp b/include/boost/python/numpy/dtype.hpp index b9e95f9b..834d0016 100644 --- a/include/boost/python/numpy/dtype.hpp +++ b/include/boost/python/numpy/dtype.hpp @@ -90,7 +90,7 @@ struct builtin_dtype { }; template <> -struct builtin_dtype { +struct BOOST_NUMPY_DECL builtin_dtype { static dtype get(); }; diff --git a/src/numpy/dtype.cpp b/src/numpy/dtype.cpp index 13904ddd..e0a22299 100644 --- a/src/numpy/dtype.cpp +++ b/src/numpy/dtype.cpp @@ -11,29 +11,33 @@ #include #define DTYPE_FROM_CODE(code) \ - dtype(python::detail::new_reference(reinterpret_cast(PyArray_DescrFromType(code)))) + dtype(python::detail::new_reference(reinterpret_cast(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 \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_INT ## bits);} \ + }; \ + template <> struct builtin_int_dtype \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_UINT ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_int_dtype(); \ + template BOOST_NUMPY_DECL dtype get_int_dtype() #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 \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_FLOAT ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_float_dtype() #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 \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_COMPLEX ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_complex_dtype() namespace boost { namespace python { namespace converter { NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayDescr_Type, numpy::dtype)