diff options
| author | 2017-03-01 21:59:37 -0800 | |
|---|---|---|
| committer | 2017-03-01 23:25:05 -0800 | |
| commit | 82afc95f7ed4e896a15d8b2a20d4f4521ed100c2 (patch) | |
| tree | a6f3e5b4f93416d67de990257155616a287a15dd /libs/gui/ConsumerBase.cpp | |
| parent | 62102e74f6b8c6e733978dbac616bce3cae59ed8 (diff) | |
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
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions