Commit d4b16250 authored by Georg Lehmann's avatar Georg Lehmann Committed by Alexandre Julliard

winevulkan: Forward declare required structs for function pointer.

parent 51b3191c
......@@ -805,11 +805,12 @@ class VkFunction(object):
class VkFunctionPointer(object):
def __init__(self, _type, name, members):
def __init__(self, _type, name, members, forward_decls):
self.name = name
self.members = members
self.type = _type
self.required = False
self.forward_decls = forward_decls
@staticmethod
def from_xml(funcpointer):
......@@ -846,10 +847,19 @@ class VkFunctionPointer(object):
_type = funcpointer.text
name = funcpointer.find("name").text
return VkFunctionPointer(_type, name, members)
if "requires" in funcpointer.attrib:
forward_decls = funcpointer.attrib.get("requires").split(",")
else:
forward_decls = []
return VkFunctionPointer(_type, name, members, forward_decls)
def definition(self):
text = "{0} {1})(\n".format(self.type, self.name)
text = ""
# forward declare required structs
for decl in self.forward_decls:
text += "typedef struct {0} {0};\n".format(decl)
text += "{0} {1})(\n".format(self.type, self.name)
first = True
if len(self.members) > 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment