Skip to content

Commit

Permalink
gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)
Browse files Browse the repository at this point in the history
(cherry picked from commit a06b606)

Co-authored-by: Diego Russo <[email protected]>
  • Loading branch information
miss-islington and diegorusso authored Jan 31, 2024
1 parent f1f0f2e commit d326d52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ctypes structs with array on Windows ARM64 platform by setting ``MAX_STRUCT_SIZE`` to 32 in stgdict. Patch by Diego Russo
2 changes: 1 addition & 1 deletion Modules/_ctypes/stgdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
/*
* The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
*/
#if defined(__aarch64__) || defined(__arm__)
#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
# define MAX_STRUCT_SIZE 32
#elif defined(__powerpc64__)
# define MAX_STRUCT_SIZE 64
Expand Down

0 comments on commit d326d52

Please sign in to comment.