aboutsummaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
Diffstat (limited to 'generator')
-rwxr-xr-xgenerator/nanopb_generator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 64514577..9cf2de5f 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -1045,7 +1045,10 @@ class ProtoFile:
else:
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
- symbol = make_identifier(headername)
+ if self.fdesc.package:
+ symbol = make_identifier(self.fdesc.package + '_' + headername)
+ else:
+ symbol = make_identifier(headername)
yield '#ifndef PB_%s_INCLUDED\n' % symbol
yield '#define PB_%s_INCLUDED\n' % symbol
try: