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
This commit is contained in:
Mark Lobodzinski 2018-03-24 13:24:18 -06:00
parent 5ddf2bc8fb
commit 299b31902c

View File

@ -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 <string.h>\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