Skip to content

Commit

Permalink
Merge pull request #48 from a-n-n-a-l-e-e/python311-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi authored Nov 17, 2023
2 parents 6f305cd + 99ffc3d commit e1a06d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/xnd/_xnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@
#endif
#endif

#if PY_VERSION_HEX >= 0x030B0000
/*
* name changed in python3.11
* https://github.com/python/cpython/pull/31657
*/
#define _PyFloat_Pack2 PyFloat_Pack2
#define _PyFloat_Pack4 PyFloat_Pack4
#define _PyFloat_Pack8 PyFloat_Pack8
#define _PyFloat_Unpack2 PyFloat_Unpack2
#define _PyFloat_Unpack4 PyFloat_Unpack4
#define _PyFloat_Unpack8 PyFloat_Unpack8
#endif


/****************************************************************************/
/* Error handling */
Expand Down
6 changes: 6 additions & 0 deletions python/xnd/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@


#include <Python.h>
#if PY_VERSION_HEX < 0x030B0000
/*
* Python 3.11 moved longintrepr.h and it is already included in Python.h
* https://github.com/python/cpython/pull/28968
*/
#include <longintrepr.h>
#endif
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
Expand Down

0 comments on commit e1a06d9

Please sign in to comment.