Skip to content

Commit

Permalink
Add workaround for numpy/numpy#16970
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Aug 1, 2023
1 parent f1ebc8d commit 7fd5228
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions astropy_healpix/_core.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/* FIXME:
* The Numpy C-API defines PyArrayDescr_Type as:
*
* #define PyArrayDescr_Type (*(PyTypeObject *)PyArray_API[3])
*
* and then in some places we need to take its address, &PyArrayDescr_Type.
* This is fine in GCC 10 and Clang, but earlier versions of GCC complain:
*
* error: dereferencing pointer to incomplete type 'PyTypeObject'
* {aka 'struct _typeobject'}
*
* As a workaround, provide a faux forward declaration for PyTypeObject.
* See https://github.com/numpy/numpy/issues/16970.
*/
struct _typeobject {};

#include <Python.h>
#include <numpy/arrayobject.h>
#include <numpy/ufuncobject.h>
Expand Down

0 comments on commit 7fd5228

Please sign in to comment.