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
This commit is contained in:
Andreas Schwab 2019-01-29 17:16:10 +01:00 committed by Miss Islington (bot)
parent 808180c206
commit 742d768656
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes Structure test_pass_by_value.

View File

@ -1058,7 +1058,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))