From: Thomas Heller Date: Wed, 7 Jun 2006 20:43:06 +0000 (+0000) Subject: Fix for foreign functions returning small structures on 64-bit big X-Git-Tag: v2.5b1~205 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=861acee04861ca4bc347a83c432e9a8bb642db4a;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 31c5f1028ad4..810849851f69 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -969,7 +969,9 @@ PyObject *_CallProc(PPROC pProc, 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