Skip to content
Snippets Groups Projects
Commit 4507b006 authored by Petteri Aimonen's avatar Petteri Aimonen
Browse files

Add code generator insertion points to files (#178).

parent 3b6099fa
No related branches found
No related tags found
No related merge requests found
......@@ -812,6 +812,7 @@ class Message:
result += ' char dummy_field;'
result += '\n'.join([str(f) for f in self.ordered_fields])
result += '\n/* @@protoc_insertion_point(struct:%s) */' % self.name
result += '\n}'
if self.packed:
......@@ -1054,6 +1055,8 @@ class ProtoFile:
noext = os.path.splitext(incfile)[0]
yield options.genformat % (noext + options.extension + '.h')
yield '\n'
yield '/* @@protoc_insertion_point(includes) */\n'
yield '#if PB_PROTO_HEADER_VERSION != 30\n'
yield '#error Regenerate this file with the current version of nanopb generator.\n'
......@@ -1149,6 +1152,7 @@ class ProtoFile:
yield '#endif\n'
# End of header
yield '/* @@protoc_insertion_point(eof) */\n'
yield '\n#endif\n'
def generate_source(self, headername, options):
......@@ -1161,6 +1165,7 @@ class ProtoFile:
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
yield options.genformat % (headername)
yield '\n'
yield '/* @@protoc_insertion_point(includes) */\n'
yield '#if PB_PROTO_HEADER_VERSION != 30\n'
yield '#error Regenerate this file with the current version of nanopb generator.\n'
......@@ -1253,6 +1258,7 @@ class ProtoFile:
yield 'PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)\n'
yield '\n'
yield '/* @@protoc_insertion_point(eof) */\n'
# ---------------------------------------------------------------------------
# Options parsing for the .proto files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment