From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- boost/libs/python/src/numpy/numpy.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 boost/libs/python/src/numpy/numpy.cpp (limited to 'boost/libs/python/src/numpy/numpy.cpp') diff --git a/boost/libs/python/src/numpy/numpy.cpp b/boost/libs/python/src/numpy/numpy.cpp new file mode 100644 index 00000000..8e259bc7 --- /dev/null +++ b/boost/libs/python/src/numpy/numpy.cpp @@ -0,0 +1,33 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL_MAIN +#include +#include + +namespace boost { namespace python { namespace numpy { + +#if PY_MAJOR_VERSION == 2 +static void wrap_import_array() +{ + import_array(); +} +#else +static void * wrap_import_array() +{ + import_array(); +} +#endif + +void initialize(bool register_scalar_converters) +{ + wrap_import_array(); + import_ufunc(); + if (register_scalar_converters) + dtype::register_scalar_converters(); +} + +}}} // namespace boost::python::numpy -- cgit v1.2.3