2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 05:02:17 +00:00

Avoid Python 3 compile warnings in NumPy initialization

This commit is contained in:
Jim Bosch
2013-08-24 18:08:01 -04:00
parent b46dfd9064
commit c9974daec2

View File

@@ -12,9 +12,19 @@ namespace boost
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)
{
import_array();
wrap_import_array();
import_ufunc();
if (register_scalar_converters)
dtype::register_scalar_converters();