[pypy-commit] cffi cffi-1.0: Don't emit _CFFI_F_CHECK_FIELDS on opaque structs (it is ignored anyway but confusing)

arigo noreply at buildbot.pypy.org
Sun Apr 26 16:14:44 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1849:8bb6d2089f42
Date: 2015-04-26 16:15 +0200
http://bitbucket.org/cffi/cffi/changeset/8bb6d2089f42/

Log:	Don't emit _CFFI_F_CHECK_FIELDS on opaque structs (it is ignored
	anyway but confusing)

diff --git a/_cffi1/recompiler.py b/_cffi1/recompiler.py
--- a/_cffi1/recompiler.py
+++ b/_cffi1/recompiler.py
@@ -462,7 +462,9 @@
         flags = []
         if isinstance(tp, model.UnionType):
             flags.append("_CFFI_F_UNION")
-        if tp.partial or tp.has_anonymous_struct_fields():
+        if tp.fldtypes is None:
+            pass    # opaque
+        elif tp.partial or tp.has_anonymous_struct_fields():
             pass    # the field layout is obtained silently from the C compiler
         else:
             flags.append("_CFFI_F_CHECK_FIELDS")


More information about the pypy-commit mailing list