From f07ac34e6f3cb61f99009ab9065e1f6a1bc8a945 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 29 Aug 2017 14:41:24 -0700 Subject: [PATCH] vulkan: Add #ifdef hack to vk_android_native_buffer.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch consolidates many potential `#ifdef ANDROID` messes throughout src/vulkan and src/intel/vulkan into a simple, localized hack. The hack is an `#ifdef ANDROID` in vk_android_native_buffer.h that, on non-Android platorms, avoids including the Android platform headers and typedefs any Android-specific types to void*. This hack doesn't remove *all* the `#ifdef ANDROID`s in upcoming patches, but it does remove a lot. I first tried implementing VK_ANDROID_native_buffer without this hack, but eventually gave up when the yak shaving became too much. Reviewed-by: Tapani Pälli --- include/vulkan/vk_android_native_buffer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/vulkan/vk_android_native_buffer.h b/include/vulkan/vk_android_native_buffer.h index d0ebf81..a658b49 100644 --- a/include/vulkan/vk_android_native_buffer.h +++ b/include/vulkan/vk_android_native_buffer.h @@ -17,8 +17,13 @@ #ifndef __VK_ANDROID_NATIVE_BUFFER_H__ #define __VK_ANDROID_NATIVE_BUFFER_H__ +/* MESA: A hack to avoid #ifdefs in driver code. */ +#ifdef ANDROID #include #include +#else +typedef void *buffer_handle_t; +#endif #ifdef __cplusplus extern "C" { -- 2.7.4