diff options
author | Thomas Heller <theller@ctypes.org> | 2006-06-06 18:50:46 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2006-06-06 18:50:46 (GMT) |
commit | d8714dedfa9bf45ce11330c006c9479b418136f9 (patch) | |
tree | de1d492db9d1c0cf943f3e7fdb247c140916200d | |
parent | ea229bd1ed3456263e31e4d979c8fa7708ff7ef1 (diff) | |
download | cpython-d8714dedfa9bf45ce11330c006c9479b418136f9.zip cpython-d8714dedfa9bf45ce11330c006c9479b418136f9.tar.gz cpython-d8714dedfa9bf45ce11330c006c9479b418136f9.tar.bz2 |
Add a hack so that foreign functions returning float now do work on 64-bit
big endian platforms.
-rw-r--r-- | Modules/_ctypes/callproc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 8163f49..31c5f10 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -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 |