Skip to content

Commit f15fff3

Browse files
authored
gh-110190: Fix ctypes structs with array on SPARC (GH-118233)
1 parent 3aff1d0 commit f15fff3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ctypes structs with array on SPARC by setting ``MAX_STRUCT_SIZE`` to 32
2+
in stgdict. Patch by Jakub Kulik

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
433433
/*
434434
* The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
435435
*/
436-
#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
436+
#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64) || defined(__sparc__)
437437
# define MAX_STRUCT_SIZE 32
438438
#elif defined(__powerpc64__)
439439
# define MAX_STRUCT_SIZE 64

0 commit comments

Comments
 (0)