aboutsummaryrefslogtreecommitdiff
path: root/patches/device_memory.rs.patch
blob: becf2c286a9ccb5f34950417c3870ca2634f2695 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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,