aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp2
-rw-r--r--patches/std.diff14
-rw-r--r--src/lib.rs3
3 files changed, 18 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 17b0085..82b2af7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,7 +26,7 @@ rust_library {
crate_name: "oorandom",
cargo_env_compat: true,
cargo_pkg_version: "11.1.3",
- srcs: ["src/lib.rs"],
+ crate_root: "src/lib.rs",
edition: "2018",
apex_available: [
"//apex_available:platform",
diff --git a/patches/std.diff b/patches/std.diff
new file mode 100644
index 0000000..4524081
--- /dev/null
+++ b/patches/std.diff
@@ -0,0 +1,14 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 8196950..f77d0b1 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -22,6 +22,9 @@
+ #![no_std]
+ use core::ops::Range;
+
++#[cfg(android_dylib)]
++extern crate std;
++
+ /// A PRNG producing a 32-bit output.
+ ///
+ /// The current implementation is `PCG-XSH-RR`.
diff --git a/src/lib.rs b/src/lib.rs
index 8196950..f77d0b1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,6 +22,9 @@
#![no_std]
use core::ops::Range;
+#[cfg(android_dylib)]
+extern crate std;
+
/// A PRNG producing a 32-bit output.
///
/// The current implementation is `PCG-XSH-RR`.