]> granicus.if.org Git - python/commitdiff
Add a hack so that foreign functions returning float now do work on 64-bit
authorThomas Heller <theller@ctypes.org>
Tue, 6 Jun 2006 18:50:46 +0000 (18:50 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 6 Jun 2006 18:50:46 +0000 (18:50 +0000)
big endian platforms.

Modules/_ctypes/callproc.c

index 8163f49c2b76e407429c50036ae84090158b213e..31c5f1028ad4776af808b070a53ecd12674d71d2 100644 (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