Commits on Source (5)
-
The module.rs file had a lot of additional intendation and other points that were automatically changed when re-formatting. Apply those formatting options to avoid it changing too much code each time it is called.
543b8897 -
Using a separate variable for version allows matching the name of the C define, ensuring grep would highlight both while making it clearer that both needs to be updated. It also brings the benefit of removing the null-character from the string itself as it can now be directly concatenated when the code is generated, which ensures a future update will not break the version by forgetting the null-character.
d215c5cc -
Check that the version symbol is available and returns the correct C-string value.
22250933 -
The vlc_static_plugins #[cfg] will be used to enforce suffixed vlc_entry_* functions naming, just like it is done in the plugin system when HAVE_DYNAMIC_PLUGINS is false, so that the modules generated from the rust buildsystem can also be linked into a static bundle of plugins. Features were considered in the first iteration of the design, since they can allow crates using vlcrs-macros to require the static entrypoint generator from the Cargo.toml file directly, but features are supposed to be used additively and not behaviour-changing so that it doesn't matter if a dependency is using the crate with extra-features when it doesn't require so. The additive design would have required to expose both the static_plugin feature and the dynamic_plugin feature, while allowing both to be enabled at the same time if needed, which meant generating two entrypoints on module!{} call. Note that #[cfg(vlc_static_plugins)] is checked at the compile time of the module being built, and not the compile time of the vlcrs-macros proc-macro crate since the cfg would not be forwarded to the crate otherwise without a proper build.rs file. Both variant are thus generated with proper #[cfg()] in the output of the module!{} macro.
8e3b6a8a -
57f26370
Showing
- include/vlc_plugin.h 4 additions, 1 deletioninclude/vlc_plugin.h
- src/rust/vlcrs-macros/Cargo.toml 3 additions, 0 deletionssrc/rust/vlcrs-macros/Cargo.toml
- src/rust/vlcrs-macros/src/module.rs 185 additions, 124 deletionssrc/rust/vlcrs-macros/src/module.rs
- src/rust/vlcrs-macros/tests/module_default.rs 4 additions, 1 deletionsrc/rust/vlcrs-macros/tests/module_default.rs