extendr / extendr/libR-sys

Implement wrappers for function-like macros

Open
#139 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
56
Forks
26
PR merge metrics
No merged PRs in 30d

Description

I'm interested in accessing some reference counting functionality in R, but I noticed that e.g. `MAYBE_SHARED`, `NO_REFERENCES` have no bindings generated. This is of course because of the fact that bindgen can't (yet) generate macros for function-like macros: https://github.com/rust-lang/rust-bindgen/issues/753.

Therefore I'm thinking it might be nice to slowly add some *manual* implementations of these macros. The simple ones like `#define CHAR(x) R_CHAR(x)` are of lower priority to me since they don't represent missing functionality, but stuff like `# define MAYBE_SHARED(x) (NAMED(x) > 1)` seems useful to me, as are more complex ones like `KNOWN_SORTED`.

The only question is whether we want these to live in `libR-sys` as opposed to `extendr`, since they're not generated and would be the first manual functions in the crate. Opinions are welcome.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.