Skip to content

Commit

Permalink
Introduce a module for the generated bindings
Browse files Browse the repository at this point in the history
Introduce a module for the generated bindings, so that we can exert more
control over the contents down the line, as everything is now scoped at
the language level.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o authored and danielocfb committed Oct 10, 2024
1 parent 307b51a commit 2de0968
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

#[cfg(all(feature = "bindgen", not(feature = "bindgen-source")))]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(any(not(feature = "bindgen"), feature = "bindgen-source"))]
include!("bindings.rs");
mod bindings {
#[cfg(all(feature = "bindgen", not(feature = "bindgen-source")))]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(any(not(feature = "bindgen"), feature = "bindgen-source"))]
include!("bindings.rs");
}

pub use bindings::*;

#[cfg(feature = "vendored-libbpf")]
macro_rules! header {
Expand Down

0 comments on commit 2de0968

Please sign in to comment.