mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 10:30:22 +00:00
winevulkan: Forward declare required structs for function pointer.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com> Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
51b3191cd3
commit
d4b162509f
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue