diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/vppapigen/vppapigen_c.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py index b7a62dc4102..bf55739094d 100644 --- a/src/tools/vppapigen/vppapigen_c.py +++ b/src/tools/vppapigen/vppapigen_c.py @@ -525,6 +525,13 @@ def generate_include_types(s, module, stream): write('#ifndef included_{module}_api_types_h\n'.format(module=module)) write('#define included_{module}_api_types_h\n'.format(module=module)) + if 'version' in s['Option']: + v = s['Option']['version'] + (major, minor, patch) = v.split('.') + write('#define VL_API_{m}_API_VERSION_MAJOR {v}\n'.format(m=module.upper(), v=major)) + write('#define VL_API_{m}_API_VERSION_MINOR {v}\n'.format(m=module.upper(), v=minor)) + write('#define VL_API_{m}_API_VERSION_PATCH {v}\n'.format(m=module.upper(), v=patch)) + if len(s['Import']): write('/* Imported API files */\n') for i in s['Import']: |