Skip to content

Commit

Permalink
Note return type of import_array as void *
Browse files Browse the repository at this point in the history
This is a nasty macro that includes a return statement.
  • Loading branch information
matthew-brett committed Jun 20, 2024
1 parent a130d8f commit 66e5c52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
6 changes: 1 addition & 5 deletions lib/fff_python_wrapper/fffpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
because PyArray_API is defined static, in order not to share that symbol
within the dso. (import_array() asks the pointer value to the python process)
*/
/*
* deal with differences in macro return result between Python 2 and 3
* http://mail.scipy.org/pipermail/numpy-discussion/2010-December/054350.html
*/
IMP_OUT fffpy_import_array(void) {
void* fffpy_import_array(void) {
import_array();
}

Expand Down
11 changes: 1 addition & 10 deletions lib/fff_python_wrapper/fffpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,8 @@
static, in order not to share that symbol within the
dso. (import_array() asks the pointer value to the python process)
*/
/*
* deal with differences in macro return result between Python 2 and 3
* http://mail.scipy.org/pipermail/numpy-discussion/2010-December/054350.html
*/
#if PY_MAJOR_VERSION >= 3
typedef int IMP_OUT;
#else
typedef void IMP_OUT;
#endif

extern IMP_OUT fffpy_import_array(void);
extern void* fffpy_import_array(void);

/*!
\brief Convert \c PyArrayObject to \c fff_vector
Expand Down

0 comments on commit 66e5c52

Please sign in to comment.