Dear R-devel,

The Writing R Extensions manual states:

6.14 Platform and version information
The header files define USING_R, which can be used to test if the code is indeed being used with R.

I suppose this only applies to building R itself?  Or, perhaps when Rcpp is used for the interface, or if one includes R headers explicitly.

I have a C++ library that is built with no R-dependencies, then wrapped with an Rcpp interface. This same library is wrapped with pybind11 in the Python world, and directly used in C++ applications.

How can the C++ library code "know" that it's R building the library? Is there a platform-independent environment variable or macro?

Thanks.

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to