diff --git a/src/memory/device_memory.rs b/src/memory/device_memory.rs index 7f6bc8ff..be1eed9f 100644 --- a/src/memory/device_memory.rs +++ b/src/memory/device_memory.rs @@ -19,7 +19,7 @@ use crate::OomError; use crate::VulkanObject; use std::error; use std::fmt; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] use std::fs::File; use std::marker::PhantomData; use std::mem::MaybeUninit; @@ -27,7 +27,7 @@ use std::ops::Deref; use std::ops::DerefMut; use std::ops::Range; use std::os::raw::c_void; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] use std::os::unix::io::{FromRawFd, IntoRawFd}; use std::ptr; use std::sync::Arc; @@ -178,7 +178,7 @@ impl<'a> DeviceMemoryBuilder<'a> { /// # Panic /// /// - Panics if the import info has already been set. - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "android", target_os = "linux"))] pub fn import_info( mut self, fd: File, @@ -572,7 +572,7 @@ impl DeviceMemory { /// /// - Panics if the user requests an invalid handle type for this device memory object. #[inline] - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "android", target_os = "linux"))] pub fn export_fd( &self, handle_type: ExternalMemoryHandleType,