summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-04-10 20:37:39 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2023-04-11 08:39:33 +0000
commit806ea64a5dc941c1ec5112ce8cb5bdcb35127710 (patch)
tree910842cbb7243458af5fa9623f01a1b7348f14b2
parentad8fb46dfb9aef59e1defe4c80775a315f98c2e1 (diff)
build-aux,codegen: allow tagging 'since' in struct types
-rw-r--r--build-aux/qmi-codegen/VariableStruct.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/build-aux/qmi-codegen/VariableStruct.py b/build-aux/qmi-codegen/VariableStruct.py
index 3e5b0ae..d63de16 100644
--- a/build-aux/qmi-codegen/VariableStruct.py
+++ b/build-aux/qmi-codegen/VariableStruct.py
@@ -45,6 +45,8 @@ class VariableStruct(Variable):
self.public_format = self.element_type
self.private_format = self.public_format
+ self.since = dictionary['since'] if 'since' in dictionary else ''
+
# Load members of this struct
self.members = []
for member_dictionary in dictionary['contents']:
@@ -108,7 +110,7 @@ class VariableStruct(Variable):
member['object'].emit_types(hfile, cfile, since, static)
translations = { 'format' : self.public_format,
- 'since' : since }
+ 'since' : since if not self.since else self.since }
template = '\n'
hfile.write(string.Template(template).substitute(translations))