Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 82afc95f authored by Alistair Strachan's avatar Alistair Strachan Committed by Jesse Hall
Browse files

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
parent 62102e74
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment