aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2024-05-09 14:20:48 -0700
committerChris Wailes <chriswailes@google.com>2024-05-09 14:20:48 -0700
commit62957d8e332bf992f4d0f6d408e3586015d7cc40 (patch)
treed4de3b36b81e52573ce13f7fa8292560cd7b6686
parent1d65c58fa4b65048568f06960ee780ddeec3cf76 (diff)
downloadryu-main.tar.gz
Ensure crate is compiled with std for panic handlerHEADmastermain
This CL adds a patch to use `extern crate std` to ensure that a panic handler is available when the crate is compiled as a dylib. Test: m libryu Bug: 333887339 Change-Id: I6ef6b9d84e8a3440825b3f271c06378bf5eaf022
-rw-r--r--patches/std.diff14
-rw-r--r--src/lib.rs3
2 files changed, 17 insertions, 0 deletions
diff --git a/patches/std.diff b/patches/std.diff
new file mode 100644
index 0000000..93ef036
--- /dev/null
+++ b/patches/std.diff
@@ -0,0 +1,14 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index cf3a732..83f6bdf 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -116,6 +116,9 @@ mod f2s;
+ mod f2s_intrinsics;
+ mod pretty;
+
++#[cfg(android_dylib)]
++extern crate std;
++
+ pub use crate::buffer::{Buffer, Float};
+
+ /// Unsafe functions that mirror the API of the C implementation of Ryū.
diff --git a/src/lib.rs b/src/lib.rs
index cf3a732..83f6bdf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -116,6 +116,9 @@ mod f2s;
mod f2s_intrinsics;
mod pretty;
+#[cfg(android_dylib)]
+extern crate std;
+
pub use crate::buffer::{Buffer, Float};
/// Unsafe functions that mirror the API of the C implementation of Ryū.