#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "alloc")]
#[doc(hidden)]
pub use alloc::format;
#[cfg(feature = "alloc")]
#[macro_export]
macro_rules! msg {
($msg:expr) => {
$crate::sol_log($msg)
};
($($arg:tt)*) => ($crate::sol_log(&$crate::format!($($arg)*)));
}
#[cfg(target_os = "solana")]
pub mod syscalls;
#[inline]
pub fn sol_log(message: &str) {
#[cfg(target_os = "solana")]
unsafe {
syscalls::sol_log_(message.as_ptr(), message.len() as u64);
}
#[cfg(all(not(target_os = "solana"), feature = "std"))]
std::println!("{message}");
#[cfg(all(not(target_os = "solana"), not(feature = "std")))]
core::hint::black_box(message);
}