summaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'generator/nanopb_generator.py')
-rw-r--r--generator/nanopb_generator.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index b9018aeb..1c214222 100644
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -75,7 +75,7 @@ class Enum:
self.values = [(self.names + x.name, x.number) for x in desc.value]
def __str__(self):
- result = 'typedef enum {\n'
+ result = 'typedef enum _%s {\n' % self.names
result += ',\n'.join([" %s = %d" % x for x in self.values])
result += '\n} %s;' % self.names
return result
@@ -276,7 +276,7 @@ class Message:
return [str(field.ctype) for field in self.fields]
def __str__(self):
- result = 'typedef struct {\n'
+ result = 'typedef struct _%s {\n' % self.name
result += '\n'.join([str(f) for f in self.ordered_fields])
result += '\n} %s;' % self.name
return result