Skip to content

Commit

Permalink
Add patch for object workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Nov 18, 2023
1 parent 6510203 commit d257af9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source:
sha256: f482ef62a10e686303f38c66f08df17b9ddee5ad82219c23571ee80d76abeea3
patches:
- numpy-args.patch
- object-workaround.patch

build:
number: 0
Expand Down
30 changes: 30 additions & 0 deletions recipe/object-workaround.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/astropy_healpix/_core.c b/astropy_healpix/_core.c
index 0a7c955..39d0dab 100644
--- a/astropy_healpix/_core.c
+++ b/astropy_healpix/_core.c
@@ -1,23 +1,3 @@
-/* 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>
--
2.42.1

0 comments on commit d257af9

Please sign in to comment.