]> granicus.if.org Git - python/commitdiff
Fix for foreign functions returning small structures on 64-bit big
authorThomas Heller <theller@ctypes.org>
Wed, 7 Jun 2006 20:43:06 +0000 (20:43 +0000)
committerThomas Heller <theller@ctypes.org>
Wed, 7 Jun 2006 20:43:06 +0000 (20:43 +0000)
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

index 31c5f1028ad4776af808b070a53ecd12674d71d2..810849851f69fd3797d101d139fe1af4c7771fda 100644 (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