libR-sys
libR-sys copied to clipboard
The generated bindings unintentionally export functions from the C standard libary
As we found on #95, half of the functions that libR-sys exports are NOT from R (e.g., lgamma is from <math.h>). I'm saying "half" because the diff on #96 would actually halve the number of exports.
Ideally, we should limit the functions to the extent of "R API." However,
- It's really difficult to distinguish "R API" programmatically; it requires us to read R Internals eagerly.
- We actually need "non-API." extendr-engine contains such ones to start and end R.
Besides, it's also difficult to eliminate the C standard library functions properly. The bindgen magically handles macros that define constants and function-likes, however, I cannot find way to do it manually. #96 is my attempt for this, but I'm afraid I cannot finish the PR.