blob: a34fe97d27a633346074956a9aa0a841b1ae232d [file] [log] [blame]
diff --git a/src/lib.rs b/src/lib.rs
index 935e432..7e87795 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -275,7 +275,8 @@
//!
//! Users should generally avoid defining a flag with a value of zero.
-#![cfg_attr(not(test), no_std)]
+// ANDROID: Use std to allow building as a dylib.
+#![cfg_attr(not(any(test, android_dylib)), no_std)]
#![doc(html_root_url = "https://docs.rs/bitflags/1.3.2")]
#[doc(hidden)]