#[allow(unused)]
use crate::common::*;
#[allow(unused)]
use std::sync::RwLock;
pub macro if_native_platform {
($it:block) => {
#[cfg(not(target_arch = "wasm32"))]
$it
},
($($it:item)+) => {
$(
#[cfg(not(target_arch = "wasm32"))]
$it
)+
},
}
pub macro if_browser {
($it:block) => {
#[cfg(target_arch = "wasm32")]
$it
},
($($it:item)+) => {
$(
#[cfg(target_arch = "wasm32")]
$it
)+
},
}
#[allow(unused)]
pub(crate) macro unsupported_platform {
() => {
panic!("Unsupported platform");
},
}
if_native_platform! {
pub use tokio;
}
#[cfg(target_os = "android")]
pub use ::android_activity as activity;
#[cfg(target_os = "android")]
pub use ::jni;
#[cfg(target_os = "android")]
#[doc(hidden)]
pub static APPLICATION: Lazy<RwLock<Option<activity::AndroidApp>>> = Lazy::new(|| RwLock::new(None));
#[cfg(target_os = "android")]
pub fn application() -> activity::AndroidApp {
APPLICATION.read().unwrap().as_ref().unwrap().clone()
}
if_browser! {
pub use wasm_bindgen as js_bindings;
pub use wasm_bindgen_futures as js_futures;
pub use js_sys as js;
}