diff options
-rw-r--r-- | python_modules/codegen.py | 6 | ||||
-rw-r--r-- | python_modules/demarshal.py | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/python_modules/codegen.py b/python_modules/codegen.py index 6d53551..009cf95 100644 --- a/python_modules/codegen.py +++ b/python_modules/codegen.py @@ -328,6 +328,12 @@ class CodeWriter: self.write("#ifdef %s" % (name)).newline() self.indentation = indentation + def ifdef_else(self, name): + indentation = self.indentation + self.indentation = 0; + self.write("#else /* %s */" % (name)).newline() + self.indentation = indentation + def endif(self, name): indentation = self.indentation self.indentation = 0; diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py index 2381e7f..c8c6837 100644 --- a/python_modules/demarshal.py +++ b/python_modules/demarshal.py @@ -1192,6 +1192,11 @@ def write_get_channel_parser(writer, channel_parsers, max_channel, is_server): writer.write(",") writer.newline() if channel and channel.has_attr("ifdef"): + writer.ifdef_else(channel.attributes["ifdef"][0]) + writer.write("{ NULL, 0 }") + if i != max_channel: + writer.write(",") + writer.newline() writer.endif(channel.attributes["ifdef"][0]) writer.end_block(semicolon = True) |