1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
/// Macro used to include code if the target_os is not 'solana'.
/// This is intended to be used for code that is primarily for off-chain Switchboard Functions.
#[macro_export]
macro_rules! cfg_client {
($($item:item)*) => {
$(
#[cfg(not(target_os = "solana"))]
#[cfg_attr(doc_cfg, doc(cfg(not(target_os = "solana"))))]
$item
)*
};
}
/// Macro used to include code only if the target_os is 'solana'.
/// This is intended to be used for code that is primarily for on-chain programs.
#[macro_export]
macro_rules! cfg_program {
($($item:item)*) => {
$(
#[cfg(target_os = "solana")]
#[cfg_attr(doc_cfg, doc(cfg(target_os = "solana")))]
$item
)*
};
}
/// Macro used to include code if the feature 'secrets' is enabled.
/// This is intended to be used for code that is primarily for off-chain Switchboard Secrets.
#[macro_export]
macro_rules! cfg_secrets {
($($item:item)*) => {
$(
#[cfg(all(feature = "secrets", not(target_os = "solana")))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "secrets", not(target_os = "solana"))))]
$item
)*
};
}
/// Macro used to include code if the feature 'macros' is enabled.
#[macro_export]
macro_rules! cfg_macros {
($($item:item)*) => {
$(
#[cfg(all(feature = "macros", not(target_os = "solana")))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "macros", not(target_os = "solana"))))]
$item
)*
};
}
/// Macro used to include IPFS code if the feature 'ipfs' is enabled.
#[macro_export]
macro_rules! cfg_ipfs {
($($item:item)*) => {
$(
#[cfg(all(feature = "ipfs", not(target_os = "solana")))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "ipfs", not(target_os = "solana"))))]
$item
)*
};
}