Skip to content

Commit 4defc50

Browse files
gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)
(cherry picked from commit a06b606) Co-authored-by: Diego Russo <[email protected]>
1 parent b3d01fc commit 4defc50

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ctypes structs with array on Windows ARM64 platform by setting ``MAX_STRUCT_SIZE`` to 32 in stgdict. Patch by Diego Russo

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
699699
/*
700700
* The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
701701
*/
702-
#if defined(__aarch64__) || defined(__arm__)
702+
#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
703703
# define MAX_STRUCT_SIZE 32
704704
#elif defined(__powerpc64__)
705705
# define MAX_STRUCT_SIZE 64

0 commit comments

Comments
 (0)