Mercurial > cpython-lru_cache-weakref
diff Modules/_ctypes/callproc.c @ 38652:fc3bcd4e44b9 legacy-trunk
Fix for foreign functions returning small structures on 64-bit big
endian machines. Should fix the remaininf failure in the PPC64
Debian buildbot.
Thanks to Matthias Klose for providing access to a machine to debug
and test this.
| author | Thomas Heller <theller@ctypes.org> |
|---|---|
| date | Wed, 07 Jun 2006 20:43:06 +0000 |
| parents | 625c2d98a1f8 |
| children | aa5a1bca28dd |
line wrap: on
line diff
--- a/Modules/_ctypes/callproc.c Wed Jun 07 20:40:54 2006 +0000 +++ b/Modules/_ctypes/callproc.c Wed Jun 07 20:43:06 2006 +0000 @@ -969,7 +969,9 @@ especially why adjusting for ffi_type_float must be avoided on 64-bit platforms. */ - if (rtype->type != FFI_TYPE_FLOAT && rtype->size < sizeof(ffi_arg)) + if (rtype->type != FFI_TYPE_FLOAT + && rtype->type != FFI_TYPE_STRUCT + && rtype->size < sizeof(ffi_arg)) resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size; #endif
