macro_rules! if_tdx_enabled {
($if_block:block else $else_block:block) => { ... };
($if_block:block) => { ... };
}
Expand description
Inserts a TDX-specific code block.
This macro conditionally executes a TDX-specific code block based on the following conditions:
(1) The cvm_guest
feature is enabled at compile time.
(2) The TDX feature is detected at runtime via ::tdx_guest::tdx_is_enabled()
.
If both conditions are met, the if_block
is executed. If an else_block
is provided, it will be executed
when either the cvm_guest
feature is not enabled or the TDX feature is not detected at runtime.