diff --git a/MAINTAINERS_GUIDE.md b/MAINTAINERS_GUIDE.md index ea8db306..f86837bd 100644 --- a/MAINTAINERS_GUIDE.md +++ b/MAINTAINERS_GUIDE.md @@ -2,6 +2,20 @@ ## Commit newly generated bindings +You last commit must contain `[generate bindings]`. You can make an empty +commit with this message: + +```sh +git commit -m "[generate bindings]" --allow-empty +``` + +Then after successfully running workflows, GitHub Actions will push a commit +with the updated bindings onto your PR branch. + +# GUIDE + +## Commit newly generated bindings + Your last commit must contain `[generate bindings]`. You can make an empty commit with this message: diff --git a/bindings/bindings-linux-aarch64-R4.2.rs b/bindings/bindings-linux-aarch64-R4.2.rs index 75f8b856..c8c3dd77 100644 --- a/bindings/bindings-linux-aarch64-R4.2.rs +++ b/bindings/bindings-linux-aarch64-R4.2.rs @@ -334,11 +334,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-linux-aarch64-R4.3.rs b/bindings/bindings-linux-aarch64-R4.3.rs index 13109071..073154db 100644 --- a/bindings/bindings-linux-aarch64-R4.3.rs +++ b/bindings/bindings-linux-aarch64-R4.3.rs @@ -340,11 +340,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-linux-aarch64-R4.4-devel.rs b/bindings/bindings-linux-aarch64-R4.4-devel.rs index 0caaa26c..e53ca971 100644 --- a/bindings/bindings-linux-aarch64-R4.4-devel.rs +++ b/bindings/bindings-linux-aarch64-R4.4-devel.rs @@ -341,11 +341,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-linux-x86_64-R4.2.rs b/bindings/bindings-linux-x86_64-R4.2.rs index 7cd2a0d7..ef497e7c 100644 --- a/bindings/bindings-linux-x86_64-R4.2.rs +++ b/bindings/bindings-linux-x86_64-R4.2.rs @@ -334,11 +334,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-linux-x86_64-R4.3.rs b/bindings/bindings-linux-x86_64-R4.3.rs index 5e38c2a8..270809c9 100644 --- a/bindings/bindings-linux-x86_64-R4.3.rs +++ b/bindings/bindings-linux-x86_64-R4.3.rs @@ -340,11 +340,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-linux-x86_64-R4.4-devel.rs b/bindings/bindings-linux-x86_64-R4.4-devel.rs index a3892864..ef99060e 100644 --- a/bindings/bindings-linux-x86_64-R4.4-devel.rs +++ b/bindings/bindings-linux-x86_64-R4.4-devel.rs @@ -341,11 +341,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-macos-aarch64-R4.3.rs b/bindings/bindings-macos-aarch64-R4.3.rs index 051bafd1..6f4c0180 100644 --- a/bindings/bindings-macos-aarch64-R4.3.rs +++ b/bindings/bindings-macos-aarch64-R4.3.rs @@ -350,11 +350,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-macos-x86_64-R4.2.rs b/bindings/bindings-macos-x86_64-R4.2.rs index d08ec446..c1fe0def 100644 --- a/bindings/bindings-macos-x86_64-R4.2.rs +++ b/bindings/bindings-macos-x86_64-R4.2.rs @@ -344,11 +344,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-macos-x86_64-R4.3.rs b/bindings/bindings-macos-x86_64-R4.3.rs index cf6f7f25..267621c1 100644 --- a/bindings/bindings-macos-x86_64-R4.3.rs +++ b/bindings/bindings-macos-x86_64-R4.3.rs @@ -350,11 +350,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-macos-x86_64-R4.4-devel.rs b/bindings/bindings-macos-x86_64-R4.4-devel.rs index e9088ccc..28436266 100644 --- a/bindings/bindings-macos-x86_64-R4.4-devel.rs +++ b/bindings/bindings-macos-x86_64-R4.4-devel.rs @@ -1,8 +1,8 @@ /* automatically generated by rust-bindgen 0.69.1 */ /* libR-sys version: 0.6.0 */ -/* bindgen clang version: Homebrew clang version 17.0.2 */ -/* clang-rs version: Homebrew clang version 17.0.2 */ +/* bindgen clang version: Homebrew clang version 17.0.3 */ +/* clang-rs version: Homebrew clang version 17.0.3 */ /* r version: 4.4.0-devel */ #[repr(C)] @@ -351,11 +351,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-windows-x86_64-R4.2.rs b/bindings/bindings-windows-x86_64-R4.2.rs index 47d14573..8f989f66 100644 --- a/bindings/bindings-windows-x86_64-R4.2.rs +++ b/bindings/bindings-windows-x86_64-R4.2.rs @@ -208,11 +208,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-windows-x86_64-R4.3.rs b/bindings/bindings-windows-x86_64-R4.3.rs index d403f524..4b45a6b4 100644 --- a/bindings/bindings-windows-x86_64-R4.3.rs +++ b/bindings/bindings-windows-x86_64-R4.3.rs @@ -214,11 +214,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/bindings/bindings-windows-x86_64-R4.4-devel.rs b/bindings/bindings-windows-x86_64-R4.4-devel.rs index 1c196d17..12dae54e 100644 --- a/bindings/bindings-windows-x86_64-R4.4-devel.rs +++ b/bindings/bindings-windows-x86_64-R4.4-devel.rs @@ -215,11 +215,6 @@ pub type Rbyte = ::std::os::raw::c_uchar; pub type R_len_t = ::std::os::raw::c_int; #[doc = "NOT YET using enum:\n 1)\tThe internal SEXPREC struct has 'SEXPTYPE type : 5'\n\t(making FUNSXP and CLOSXP equivalent in there),\n\tgiving (-Wall only ?) warnings all over the place\n 2)\tMany switch(type) { case ... } statements need a final `default:'\n\tadded in order to avoid warnings like \\[e.g. l.170 of ../main/util.c\\]\n\t \"enumeration value `FUNSXP' not handled in switch\""] pub type SEXPTYPE = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SEXPREC { - _unused: [u8; 0], -} pub type SEXP = *mut SEXPREC; #[doc = "We sometimes need to coerce a protected value and place the new\ncoerced value under protection. For these cases PROTECT_WITH_INDEX\nsaves an index of the protection location that can be used to\nreplace the protected value using REPROTECT."] pub type PROTECT_INDEX = ::std::os::raw::c_int; diff --git a/build.rs b/build.rs index 768c4d56..6d493211 100644 --- a/build.rs +++ b/build.rs @@ -529,6 +529,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!( diff --git a/src/lib.rs b/src/lib.rs index cd882a0a..d30fe11d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,6 +66,11 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +#[non_exhaustive] +#[repr(transparent)] +#[derive(Debug)] +pub struct SEXPREC(std::ffi::c_void); + #[cfg(test)] mod tests { use super::*;