1 // Copyright Jim Bosch 2010-2012. 2 // Copyright Stefan Seefeld 2016. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 #define BOOST_PYTHON_NUMPY_INTERNAL_MAIN 8 #include <boost/python/numpy/internal.hpp> 9 #include <boost/python/numpy/dtype.hpp> 10 11 namespace boost { namespace python { namespace numpy { 12 13 #if PY_MAJOR_VERSION == 2 wrap_import_array()14static void wrap_import_array() 15 { 16 import_array(); 17 } 18 #else 19 static void * wrap_import_array() 20 { 21 import_array(); 22 return NULL; 23 } 24 #endif 25 initialize(bool register_scalar_converters)26void initialize(bool register_scalar_converters) 27 { 28 wrap_import_array(); 29 import_ufunc(); 30 if (register_scalar_converters) 31 dtype::register_scalar_converters(); 32 } 33 34 }}} // namespace boost::python::numpy 35