Skip to content

Commit

Permalink
Replace SEXPREC with something truly opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
CGMossa committed Nov 18, 2023
1 parent 6fc2b5f commit ced9225
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ fn generate_bindings(r_paths: &InstallationPaths, version_info: &RVersionInfo) {
// Remove all Fortran items, these are items with underscore _ postfix
let bindgen_builder = bindgen_builder.blocklist_item("[A-Za-z_][A-Za-z0-9_]*[^_]_$");

// Ensure that `SEXPREC` is opaque to Rust
let bindgen_builder = bindgen_builder.blocklist_item("SEXPREC");

// Finish the builder and generate the bindings.
let bindings = bindgen_builder
.raw_line(format!(
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[repr(transparent)]
#[derive(Debug)]
pub struct SEXPREC(std::ffi::c_void);

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit ced9225

Please sign in to comment.