]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 31 Jan 2024 00:08:26 +0000 (01:08 +0100)
committerGitHub <noreply@github.com>
Wed, 31 Jan 2024 00:08:26 +0000 (00:08 +0000)
(cherry picked from commit a06b606462740058b5d52fefdcdcd679d4f40260)

Co-authored-by: Diego Russo <diego.russo@arm.com>
Misc/NEWS.d/next/Library/2024-01-30-15-34-08.gh-issue-110190.Z5PQQX.rst [new file with mode: 0644]
Modules/_ctypes/stgdict.c

diff --git a/Misc/NEWS.d/next/Library/2024-01-30-15-34-08.gh-issue-110190.Z5PQQX.rst b/Misc/NEWS.d/next/Library/2024-01-30-15-34-08.gh-issue-110190.Z5PQQX.rst
new file mode 100644 (file)
index 0000000..af77e40
--- /dev/null
@@ -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
index 777d7e194f57922de42da9d0a7fa50b0a0df408e..cbf129d8b3c0e5ee61e1475d2ac4d3eb829f4e7e 100644 (file)
@@ -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