From c79277ae0703934a65bdab11629664c863768751 Mon Sep 17 00:00:00 2001 From: David Hubbard Date: Fri, 19 Aug 2016 13:30:06 -0600 Subject: adding vulkan.py extension.ifdef field to vulkan.py Some extensions are disabled at compile time and must not be included in generated code. Issue #72 gh72. This adds a new optional field ifdef which contains the #define symbol to insert as a guard around generated code. Change-Id: I30b521dd1ff77d0db1608cb11c8c999cef40dff2 --- vulkan.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vulkan.py b/vulkan.py index 97d87069..4a9b7966 100644 --- a/vulkan.py +++ b/vulkan.py @@ -159,11 +159,12 @@ class Proto(object): (self.ret, self.name, param_str) class Extension(object): - def __init__(self, name, headers, objects, protos): + def __init__(self, name, headers, objects, protos, ifdef = None): self.name = name self.headers = headers self.objects = objects self.protos = protos + self.ifdef = ifdef def __repr__(self): lines = [] @@ -1160,6 +1161,7 @@ ext_khr_xlib_surface = Extension( name="VK_KHR_xlib_surface", headers=["vulkan/vulkan.h"], objects=[], + ifdef="VK_USE_PLATFORM_XLIB_KHR", protos=[ Proto("VkResult", "CreateXlibSurfaceKHR", [Param("VkInstance", "instance"), -- cgit v1.2.3