Add a hack so that foreign functions returning float now do work on 64-bit

big endian platforms.
This commit is contained in:
Thomas Heller 2006-06-06 18:50:46 +00:00
parent ea229bd1ed
commit d8714dedfa
1 changed files with 6 additions and 1 deletions

View File

@ -964,7 +964,12 @@ PyObject *_CallProc(PPROC pProc,
address cannot simply be used as result pointer, instead we must
adjust the pointer value:
*/
if (rtype->size < sizeof(ffi_arg))
/*
XXX I should find out and clarify why this is needed at all,
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))
resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size;
#endif