]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 29 Jan 2019 21:11:36 +0000 (13:11 -0800)
committerGitHub <noreply@github.com>
Tue, 29 Jan 2019 21:11:36 +0000 (13:11 -0800)
This fixes the ctypes.test.test_structures.StructureTestCase test.

https://bugs.python.org/issue35847
(cherry picked from commit 742d768656512a469ce9571b1cbd777def7bc5ea)

Co-authored-by: Andreas Schwab <schwab@linux-m68k.org>
Misc/NEWS.d/next/Library/2019-01-29-09-11-09.bpo-35847.eiSi4t.rst [new file with mode: 0644]
Modules/_ctypes/callproc.c

diff --git a/Misc/NEWS.d/next/Library/2019-01-29-09-11-09.bpo-35847.eiSi4t.rst b/Misc/NEWS.d/next/Library/2019-01-29-09-11-09.bpo-35847.eiSi4t.rst
new file mode 100644 (file)
index 0000000..e3775f9
--- /dev/null
@@ -0,0 +1 @@
+RISC-V needed the CTYPES_PASS_BY_REF_HACK.  Fixes ctypes Structure test_pass_by_value.
index ec596b4de31d4066daed9b8be5817aa8343a1d74..e971388f69b92fb746c7cdd1860b3b0f972ab4c1 100644 (file)
@@ -1052,7 +1052,7 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
 #endif
 
 #if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
-    defined(__aarch64__)
+    defined(__aarch64__) || defined(__riscv)
 #define CTYPES_PASS_BY_REF_HACK
 #define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
 #define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))