summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-06-07 20:43:06 (GMT)
committerThomas Heller <theller@ctypes.org>2006-06-07 20:43:06 (GMT)
commit861acee04861ca4bc347a83c432e9a8bb642db4a (patch)
treefa3a62346de4155143a388da59061afb01849c0d /Modules
parentd5474eaed773496c03294d1f359008450d95d622 (diff)
downloadcpython-861acee04861ca4bc347a83c432e9a8bb642db4a.zip
cpython-861acee04861ca4bc347a83c432e9a8bb642db4a.tar.gz
cpython-861acee04861ca4bc347a83c432e9a8bb642db4a.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callproc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 31c5f10..8108498 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