]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110190: Fix ctypes structs with array on SPARC (GH-118233)
authorJakub Kulík <Kulikjak@gmail.com>
Tue, 17 Sep 2024 17:06:53 +0000 (19:06 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2024 17:06:53 +0000 (19:06 +0200)
Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst [new file with mode: 0644]
Modules/_ctypes/stgdict.c

diff --git a/Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst b/Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst
new file mode 100644 (file)
index 0000000..abc3ddb
--- /dev/null
@@ -0,0 +1,2 @@
+Fix ctypes structs with array on SPARC by setting ``MAX_STRUCT_SIZE`` to 32
+in stgdict. Patch by Jakub Kulik
index c9cd1c6e7381f6932fa5096dd47c14409fb61262..5dbbe0b3285d58dd56e4e2d65ab0ffff0e1fb9b5 100644 (file)
@@ -433,7 +433,7 @@ PyCStructUnionType_update_stginfo(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__) || defined(_M_ARM64)
+#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64) || defined(__sparc__)
 #  define MAX_STRUCT_SIZE 32
 #elif defined(__powerpc64__)
 #  define MAX_STRUCT_SIZE 64