From ac274b1d46692b596baebf0d96ca2d7eeffd2ff1 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Sat, 24 Mar 2018 13:24:18 -0600 Subject: [PATCH] scripts: Fix safe_struct Android versioning issue The VK_ANDROID_external_memory_android_hardware_buffer extension uses an android structure that is undefined before android 'O'. Worked around this issue by defining a dummy structure for earlier android OS versions. Change-Id: If515920d3b1707cbeb6a0377827c680d93d516ff --- scripts/helper_file_generator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/helper_file_generator.py b/scripts/helper_file_generator.py index ca9ffc5..ea4800d 100644 --- a/scripts/helper_file_generator.py +++ b/scripts/helper_file_generator.py @@ -723,6 +723,12 @@ class HelperFileOutputGenerator(OutputGenerator): safe_struct_helper_source = '\n' safe_struct_helper_source += '#include "vk_safe_struct.h"\n' safe_struct_helper_source += '#include \n' + safe_struct_helper_source += '#ifdef VK_USE_PLATFORM_ANDROID_KHR\n' + safe_struct_helper_source += '#if __ANDROID_API__ < __ANDROID_API_O__\n' + safe_struct_helper_source += 'struct AHardwareBuffer {};\n' + safe_struct_helper_source += '#endif\n' + safe_struct_helper_source += '#endif\n' + safe_struct_helper_source += '\n' safe_struct_helper_source += self.GenerateSafeStructSource() return safe_struct_helper_source -- 2.7.4