Skip to content

Commit

Permalink
Stabilize --wrap-static-fns
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Sep 7, 2024
1 parent fd37d68 commit b50d724
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions bindgen-cli/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ struct BindgenCommand {
#[arg(long, value_name = "CUSTOM", value_parser = parse_custom_attribute)]
with_attribute_custom_union: Vec<(Vec<String>, String)>,
/// Generate wrappers for `static` and `static inline` functions.
#[arg(long, requires = "experimental")]
#[arg(long)]
wrap_static_fns: bool,
/// Sets the PATH for the source file that must be created due to the presence of `static` and
/// `static inline` functions.
#[arg(long, requires = "experimental", value_name = "PATH")]
#[arg(long, value_name = "PATH")]
wrap_static_fns_path: Option<PathBuf>,
/// Sets the SUFFIX added to the extern wrapper functions generated for `static` and `static
/// inline` functions.
#[arg(long, requires = "experimental", value_name = "SUFFIX")]
#[arg(long, value_name = "SUFFIX")]
wrap_static_fns_suffix: Option<String>,
/// Set the default VISIBILITY of fields, including bitfields and accessor methods for
/// bitfields. This flag is ignored if the `--respect-cxx-access-specs` flag is used.
Expand Down
2 changes: 1 addition & 1 deletion bindgen-tests/tests/headers/wrap-static-fns.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bindgen-flags: --experimental --wrap-static-fns
// bindgen-flags: --wrap-static-fns
// bindgen-parse-callbacks: wrap-as-variadic-fn

// to avoid polluting the expectation tests we put the stdarg.h behind a conditional
Expand Down
9 changes: 2 additions & 7 deletions bindgen/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1419,10 +1419,8 @@ options! {
/// Note that they will usually not work. However you can use `-fkeep-inline-functions`
/// or `-fno-inline-functions` if you are responsible of compiling the library to make
/// them callable.
#[cfg_attr(
feature = "experimental",
doc = "\nCheck the [`Builder::wrap_static_fns`] method for an alternative."
)]
///
/// Check the [`Builder::wrap_static_fns`] method for an alternative.
pub fn generate_inline_functions(mut self, doit: bool) -> Self {
self.options.generate_inline_functions = doit;
self
Expand Down Expand Up @@ -2021,7 +2019,6 @@ options! {
/// Whether to generate wrappers for `static` functions.
wrap_static_fns: bool {
methods: {
#[cfg(feature = "experimental")]
/// Set whether to generate wrappers for `static`` functions.
///
/// Passing `true` to this method will generate a C source file with non-`static`
Expand All @@ -2040,7 +2037,6 @@ options! {
/// The suffix to be added to the function wrappers for `static` functions.
wrap_static_fns_suffix: Option<String> {
methods: {
#[cfg(feature = "experimental")]
/// Set the suffix added to the wrappers for `static` functions.
///
/// This option only comes into effect if `true` is passed to the
Expand All @@ -2057,7 +2053,6 @@ options! {
/// The path of the file where the wrappers for `static` functions will be emitted.
wrap_static_fns_path: Option<PathBuf> {
methods: {
#[cfg(feature = "experimental")]
/// Set the path for the source code file that would be created if any wrapper
/// functions must be generated due to the presence of `static` functions.
///
Expand Down

0 comments on commit b50d724

Please sign in to comment.