Skip to content

Commit

Permalink
Revert "Remove old placeholder workaround"
Browse files Browse the repository at this point in the history
This reverts commit a151174.
  • Loading branch information
lpsinger committed Nov 20, 2023
1 parent 5ecc9d9 commit 8c2c5df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions astropy_healpix/_core.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* 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.
*
* Drop this when supporting gcc < 10 becomes irrelevant.
*/
struct _typeobject {
int _placeholder;
};

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

0 comments on commit 8c2c5df

Please sign in to comment.