Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1052:0b90939873ae
Date: 2012-11-20 17:38 +0100
http://bitbucket.org/cffi/cffi/changeset/0b90939873ae/
Log: Move this special-case logic after the code above, which is still
useful to check for error cases.
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -3523,19 +3523,6 @@
return NULL;
}
-#ifdef USE_C_LIBFFI_MSVC
- /* MSVC returns small structures in registers. Pretend int32 or
- int64 return type. This is needed as a workaround for what
- is really a bug of libffi_msvc seen as an independent library
- (ctypes has a similar workaround). */
- if (is_result_type) {
- if (ct->ct_size <= 4)
- return &ffi_type_sint32;
- if (ct->ct_size <= 8)
- return &ffi_type_sint64;
- }
-#endif
-
n = PyDict_Size(ct->ct_stuff);
nflat = 0;
@@ -3569,6 +3556,19 @@
}
assert(cf == NULL);
+#ifdef USE_C_LIBFFI_MSVC
+ /* MSVC returns small structures in registers. Pretend int32 or
+ int64 return type. This is needed as a workaround for what
+ is really a bug of libffi_msvc seen as an independent library
+ (ctypes has a similar workaround). */
+ if (is_result_type) {
+ if (ct->ct_size <= 4)
+ return &ffi_type_sint32;
+ if (ct->ct_size <= 8)
+ return &ffi_type_sint64;
+ }
+#endif
+
/* next, allocate and fill the flattened list */
elements = fb_alloc(fb, (nflat + 1) * sizeof(ffi_type*));
nflat = 0;
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit