blob: ed76c3ed0c4879a4ed8b320b252f0f1f26b839c1 [file] [log] [blame]
diff --git a/src/lib.rs b/src/lib.rs
index 2811996..4faa975 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,8 @@
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![deny(warnings)]
-#![cfg_attr(not(test), no_std)]
+// ANDROID: Use std to allow building as a dylib.
+#![cfg_attr(not(any(test, android_dylib)), no_std)]
//! A light-weight lock guarded by an atomic boolean.
//!
@@ -43,7 +44,8 @@
//! assert_eq!(locked2.name, "Spanner Bundle");
//! ```
-#[cfg(test)]
+// ANDROID: Use std to allow building as a dylib.
+#[cfg(any(test, android_dylib))]
extern crate core;
use core::cell::UnsafeCell;