[pypy-svn] r42080 - pypy/dist/pypy/rpython/rctypes/tool

afa at codespeak.net afa at codespeak.net
Mon Apr 16 00:50:08 CEST 2007


Author: afa
Date: Mon Apr 16 00:50:08 2007
New Revision: 42080

Modified:
   pypy/dist/pypy/rpython/rctypes/tool/ctypes_platform.py
Log:
Generate C89-compliant code, and corresponding tests pass on Windows


Modified: pypy/dist/pypy/rpython/rctypes/tool/ctypes_platform.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/tool/ctypes_platform.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/tool/ctypes_platform.py	Mon Apr 16 00:50:08 2007
@@ -129,7 +129,6 @@
     def prepare_code(self):
         if self.ifdef is not None:
             yield '#ifdef %s' % (self.ifdef,)
-            yield 'dump("defined", 1);'
         yield 'typedef %s ctypesplatcheck_t;' % (self.name,)
         yield 'typedef struct {'
         yield '    char c;'
@@ -137,6 +136,8 @@
         yield '} ctypesplatcheck2_t;'
         yield ''
         yield 'ctypesplatcheck_t s;'
+        if self.ifdef is not None:
+            yield 'dump("defined", 1);'
         yield 'dump("align", offsetof(ctypesplatcheck2_t, s));'
         yield 'dump("size",  sizeof(ctypesplatcheck_t));'
         for fieldname, fieldtype in self.interesting_fields:
@@ -231,10 +232,11 @@
     def prepare_code(self):
         if self.ifdef is not None:
             yield '#ifdef %s' % (self.ifdef,)
-            yield 'dump("defined", 1);'
         yield 'typedef %s ctypesplatcheck_t;' % (self.name,)
         yield ''
         yield 'ctypesplatcheck_t x;'
+        if self.ifdef is not None:
+            yield 'dump("defined", 1);'
         yield 'dump("size",  sizeof(ctypesplatcheck_t));'
         if self.ctype_hint in integer_class:
             yield 'x = 0; x = ~x;'



More information about the Pypy-commit mailing list