Skip to content

Commit d326d52

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 f1f0f2e commit d326d52

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
@@ -665,7 +665,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
665665
/*
666666
* The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
667667
*/
668-
#if defined(__aarch64__) || defined(__arm__)
668+
#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
669669
# define MAX_STRUCT_SIZE 32
670670
#elif defined(__powerpc64__)
671671
# define MAX_STRUCT_SIZE 64

0 commit comments

Comments
 (0)