From: Petteri Aimonen Date: Sun, 23 Oct 2016 11:43:24 +0000 (+0300) Subject: Set the proto3 option by default if file specifies proto3 syntax X-Git-Tag: 5.0.2~186^2~53 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=f866af7db7af0c42e5394a714a61513d189f2ba3;p=apps%2Fagl-service-can-low-level.git Set the proto3 option by default if file specifies proto3 syntax --- diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 5c53a633..3e543942 100755 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -1356,6 +1356,9 @@ def get_nanopb_suboptions(subdesc, options, name): Globals.matched_namemasks.add(namemask) new_options.MergeFrom(options) + if hasattr(subdesc, 'syntax') and subdesc.syntax == "proto3": + new_options.proto3 = True + # Handle options defined in .proto if isinstance(subdesc.options, descriptor.FieldOptions): ext_type = nanopb_pb2.nanopb