Fix <vulkan/vulkan.h> compatibility with C.
When the <android/native_window.h> include was removed from <vulkan/vk_platform.h> and replaced with a 'struct ANativeWindow;', it preserved compatibility only for C++, because in C the 'struct' keyword must be used explicitly, or a typedef with the alias must exist in scope. As neither is the case any more, C programs using the Android vulkan headers do not build. I dabbled with changing the forward declaration of the struct with a typedef in <vulkan/vk_platform.h>, but this would only work for C11 (prior to that clang will warn by default, gcc will warn with -pedantic), which seems like an onerous requirement for third party software. This warning could occur if both <vulkan/vk_platform.h> and <android/native_window.h> were included, because the latter already has a C compatibility typedef. Test: make Change-Id: I98e579b0f076fe9ab808827d61da83d2c3ea90e6
Loading
Please register or sign in to comment