Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r2343:c0269f40b3d4
Date: 2015-10-16 09:31 +0200
http://bitbucket.org/cffi/cffi/changeset/c0269f40b3d4/

Log:    win64 libffi issue

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -3787,8 +3787,15 @@
             ffitype = &ffi_type_float;
         else if (strcmp(ptypes->name, "double") == 0)
             ffitype = &ffi_type_double;
-        else if (strcmp(ptypes->name, "long double") == 0)
-            ffitype = &ffi_type_longdouble;
+        else if (strcmp(ptypes->name, "long double") == 0) {
+            /* assume that if sizeof(double) == sizeof(long double), then
+               the two types are equivalent for C.  libffi bugs on Win64
+               if a function's return type is ffi_type_longdouble... */
+            if (sizeof(double) == sizeof(long double))
+                ffitype = &ffi_type_double;
+            else
+                ffitype = &ffi_type_longdouble;
+        }
         else
             goto bad_ffi_type;
     }
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to