Skip to content

Commit 742d768

Browse files
andreas-schwabmiss-islington
authored andcommitted
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
1 parent 808180c commit 742d768

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
@@ -1058,7 +1058,7 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
10581058
#endif
10591059

10601060
#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
1061-
defined(__aarch64__)
1061+
defined(__aarch64__) || defined(__riscv)
10621062
#define CTYPES_PASS_BY_REF_HACK
10631063
#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
10641064
#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))

0 commit comments

Comments
 (0)