diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-12 15:41:35 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-12 15:41:57 +0200 |
commit | e7fd4541df08c674157b842e46db4877e074716b (patch) | |
tree | cc73bf9c02d190ec16935665855083ac8b5c0806 /rtemsspec/interface.py | |
parent | spec: Add function attributes (diff) | |
download | rtems-central-e7fd4541df08c674157b842e46db4877e074716b.tar.bz2 |
interface: Support function attributes
Diffstat (limited to 'rtemsspec/interface.py')
-rw-r--r-- | rtemsspec/interface.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rtemsspec/interface.py b/rtemsspec/interface.py index fdbcfc90..5c121680 100644 --- a/rtemsspec/interface.py +++ b/rtemsspec/interface.py @@ -356,16 +356,18 @@ class Node: def _get_function_definition(self, item: Item, definition: Any) -> Lines: content = CContent() name = item["name"] + attrs = self.substitute_code(definition["attributes"]) + attrs = f"{attrs} " if attrs else "" ret = self.substitute_code(definition["return"]) params = [ self.substitute_code(param) for param in definition["params"] ] body = definition["body"] if body: - with content.function("static inline " + ret, name, params): + with content.function(f"{attrs}static inline {ret}", name, params): content.add(self.substitute_code(body)) else: - content.declare_function(ret, name, params) + content.declare_function(f"{attrs}{ret}", name, params) return content.lines def _get_macro_definition(self, item: Item, definition: Any) -> Lines: |