sp-api: Make the generated code act based on std in sp-api (#14267)

* sp-api: Make the generated code act based on `std` in `sp-api`

Instead of letting the macro generate code that checks if the `std` feature is enabled, it will now
generate code that checks if the `std` feature is enabled for the `sp-api` crate. The old
implementation basically required that the crate in which the macro was used, had a `std` feature.
Now we don't have this requirement anymore and act accordingly the feature in `sp-api` directly.

* Missing feature!

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2023-06-01 15:29:32 +01:00
committed by GitHub
parent 186423b695
commit 372708d7a2
6 changed files with 201 additions and 187 deletions
+3
View File
@@ -750,3 +750,6 @@ decl_runtime_apis! {
fn metadata_versions() -> sp_std::vec::Vec<u32>;
}
}
sp_core::generate_feature_enabled_macro!(std_enabled, feature = "std", $);
sp_core::generate_feature_enabled_macro!(std_disabled, not(feature = "std"), $);