mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-protocol
synced 2025-12-27 07:01:36 +00:00
codegen: struct marshallers are not current function helper
This solves the issue of struct_marshallers being included within the current ifdef/endif body, although they are independant functions.
This commit is contained in:
parent
94a46ebc2a
commit
ecce70452f
@ -99,7 +99,7 @@ class SubMarshallingSource(MarshallingSource):
|
||||
else:
|
||||
return self.parent_src.get_ref(self.name) + "." + member
|
||||
|
||||
def write_marshal_ptr_function(writer, target_type):
|
||||
def write_marshal_ptr_function(writer, target_type, is_helper=True):
|
||||
if target_type.is_array():
|
||||
marshal_function = "spice_marshall_array_%s" % target_type.element_type.primitive_type()
|
||||
else:
|
||||
@ -116,7 +116,8 @@ def write_marshal_ptr_function(writer, target_type):
|
||||
names_args = "".join(n)
|
||||
|
||||
header = writer.header
|
||||
writer = writer.function_helper()
|
||||
if is_helper:
|
||||
writer = writer.function_helper()
|
||||
writer.header = header
|
||||
writer.out_prefix = ""
|
||||
if target_type.is_array():
|
||||
|
||||
@ -188,7 +188,7 @@ if options.generate_marshallers:
|
||||
if options.struct_marshallers:
|
||||
for structname in options.struct_marshallers:
|
||||
t = ptypes.lookup_type(structname)
|
||||
marshal.write_marshal_ptr_function(writer, t)
|
||||
marshal.write_marshal_ptr_function(writer, t, False)
|
||||
|
||||
if options.generate_marshallers or (options.struct_marshallers and len(options.struct_marshallers) > 0):
|
||||
marshal.write_trailer(writer)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user