From 861acee04861ca4bc347a83c432e9a8bb642db4a Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Wed, 7 Jun 2006 20:43:06 +0000 Subject: [PATCH] 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. --- Modules/_ctypes/callproc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 31c5f1028a..810849851f 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 -- 2.50.1