Skip to content

Commit 10354cb

Browse files
bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)
This fixes the ctypes.test.test_structures.StructureTestCase test. https://bugs.python.org/issue35847 (cherry picked from commit 742d768) Co-authored-by: Andreas Schwab <schwab@linux-m68k.org>
1 parent ff27f81 commit 10354cb

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+
RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes Structure test_pass_by_value.

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
10521052
#endif
10531053

10541054
#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
1055-
defined(__aarch64__)
1055+
defined(__aarch64__) || defined(__riscv)
10561056
#define CTYPES_PASS_BY_REF_HACK
10571057
#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
10581058
#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))

0 commit comments

Comments
 (0)