Skip to content
Snippets Groups Projects
Commit e69b79e8 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Fix import_array() call when exporting numpy functionality

import_array() must be called when the numpy C-API is called.
This is a macro that in our case defined a return value that makes
the compiler complain. The added #define statement enforces no return value
parent 5f9ab1dc
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,8 @@ namespace {
void export_primlist()
{
#if OST_NUMPY_SUPPORT_ENABLED
// The following define enforces no return value when calling import_array
#define NUMPY_IMPORT_ARRAY_RETVAL
import_array(); // magic handshake for numpy module
#endif
......
......@@ -227,6 +227,8 @@ void set_t_pos(XCSEditor& e, object o1, object o2)
void export_Editors()
{
#if OST_NUMPY_SUPPORT_ENABLED
// The following define enforces no return value when calling import_array
#define NUMPY_IMPORT_ARRAY_RETVAL
import_array();
#endif
......
......@@ -130,6 +130,8 @@ bool depr_is_transformation_identity(const EntityHandle& eh)
void export_Entity()
{
#if OST_NUMPY_SUPPORT_ENABLED
// The following define enforces no return value when calling import_array
#define NUMPY_IMPORT_ARRAY_RETVAL
import_array();
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment