turnip/android: Use DETECT_OS_ANDROID in tu_device

ANDROID definition is not available in some cases.

Fixes: 99753001f3 ("turnip: Support AHardwareBuffer")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11242
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29478>
This commit is contained in:
Roman Stratiienko
2024-05-30 10:31:26 +00:00
committed by Marge Bot
parent c1373239f2
commit 6fee2715ce

View File

@@ -2818,7 +2818,7 @@ tu_AllocateMemory(VkDevice _device,
close(fd_info->fd);
}
} else if (mem->vk.ahardware_buffer) {
#ifdef ANDROID
#if DETECT_OS_ANDROID
const native_handle_t *handle = AHardwareBuffer_getNativeHandle(mem->vk.ahardware_buffer);
assert(handle->numFds > 0);
size_t size = lseek(handle->data[0], 0, SEEK_END);