[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Patrick Stewart
Patrick Stewart added the comment: Actually the current released version of libffi (3.2.1) is even more severely broken on win64, you can't return structs at all. (patch here https://github.com/patstew/MINGW-packages/blob/9c3910fa32c45448826a2241c3fba3bf6abf9428/mingw-w64-libffi

[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-03 Thread Patrick Stewart
Patrick Stewart added the comment: There's some confusion above about clang - that's completely irrelevant, the problem was using ctypes to call into libclang, not using clang to compile anything. The problem applies to any callback function that returns a struct larger than 8 bytes with any

[issue17310] Ctypes callbacks shows problem on Windows Python (64bit)

2016-07-21 Thread Patrick Stewart
Patrick Stewart added the comment: I've attached a patch with an extra fix to the duplicated issue 20160 http://bugs.python.org/issue20160 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-07-21 Thread Patrick Stewart
Patrick Stewart added the comment: This is still a problem, and the suggested fix seems to work. There is another error a few lines above where it is allocating 4 bytes for a pointer. I've attached a new patch with both fixes, but without Bob's tests. This issue is a duplicate of 17310

[issue17310] Ctypes callbacks shows problem on Windows Python (64bit)

2016-07-20 Thread Patrick Stewart
Patrick Stewart added the comment: This also fixes python 3.5 -- nosy: +Patrick Stewart ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i