Skip to content

Commit

Permalink
remove wrapper module around generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
micahrj committed Feb 5, 2024
1 parent 72af809 commit 2782a9f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions vst3-bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ pub fn generate(
writeln!(source, "#include \"{}\"", name)?;
}

writeln!(sink, "mod __bindings {{")?;
writeln!(sink)?;

writeln!(sink, "{}", include_str!("support.rs"))?;

let mut generator = com_scrape::Generator::default()
Expand All @@ -89,10 +86,10 @@ pub fn generate(
])
.skip_interface_trait("FUnknown")
.constant_parser(parse_iid)
.iid_generator(|name| format!("crate::__bindings::tuid_as_guid({name}_iid)"))
.query_interface_fn("crate::__bindings::FUnknown_query_interface")
.add_ref_fn("crate::__bindings::FUnknown_add_ref")
.release_fn("crate::__bindings::FUnknown_release")
.iid_generator(|name| format!("tuid_as_guid({name}_iid)"))
.query_interface_fn("FUnknown_query_interface")
.add_ref_fn("FUnknown_add_ref")
.release_fn("FUnknown_release")
.include_path(sdk_dir);

if let Some(target) = target {
Expand All @@ -101,9 +98,5 @@ pub fn generate(

generator.generate(source, &mut sink)?;

writeln!(sink)?;
writeln!(sink, "}}")?;
writeln!(sink, "pub use __bindings::*;")?;

Ok(())
}

0 comments on commit 2782a9f

Please sign in to comment.