diff --git a/src/allocator.cpp b/src/allocator.cpp index 6282c4852..ee070aa0b 100644 --- a/src/allocator.cpp +++ b/src/allocator.cpp @@ -1933,6 +1933,7 @@ void VkWeightStagingAllocator::fastFree(VkImageMemory* /*ptr*/) { } +#if NCNN_PLATFORM_API #if __ANDROID_API__ >= 26 VkAndroidHardwareBufferImageAllocator::VkAndroidHardwareBufferImageAllocator(const VulkanDevice* _vkdev, AHardwareBuffer* _hb) : VkAllocator(_vkdev), hb(_hb) @@ -2171,6 +2172,7 @@ uint64_t VkAndroidHardwareBufferImageAllocator::external_format() const return bufferFormatProperties.externalFormat; } #endif // __ANDROID_API__ >= 26 +#endif // NCNN_PLATFORM_API #endif // NCNN_VULKAN