[pypy-svn] r17175 - pypy/dist/pypy/translator/c
tismer at codespeak.net
tismer at codespeak.net
Sat Sep 3 16:45:20 CEST 2005
Author: tismer
Date: Sat Sep 3 16:45:19 2005
New Revision: 17175
Modified:
pypy/dist/pypy/translator/c/node.py
Log:
added survival kit for empty structs
Modified: pypy/dist/pypy/translator/c/node.py
==============================================================================
--- pypy/dist/pypy/translator/c/node.py (original)
+++ pypy/dist/pypy/translator/c/node.py Sat Sep 3 16:45:19 2005
@@ -100,6 +100,7 @@
def definition(self, phase):
gcpolicy = self.db.gcpolicy
+ is_empty = True
if phase == 1:
yield 'struct %s {' % self.name
# gcheader
@@ -107,12 +108,17 @@
line = gcpolicy.struct_gcheader_definition(self)
if line:
yield '\t' + line
+ is_empty = False
for name, typename in self.fields:
line = '%s;' % cdecl(typename, name)
if typename == PrimitiveType[Void]:
line = '/* %s */' % line
+ else:
+ is_empty = False
yield '\t' + line
+ if is_empty:
+ yield '\t' + 'int _dummy; /* this struct is empty */'
yield '};'
for line in gcpolicy.struct_after_definition(self):
More information about the Pypy-commit
mailing list