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.
This commit is contained in:
Thomas Heller 2006-06-07 20:43:06 +00:00
parent d5474eaed7
commit 861acee048
1 changed files with 3 additions and 1 deletions

View File

@ -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