-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development version broken for STRICT_R_HEADERS #612
Comments
It is an oversight by our newest team member. We'll fix. Thanks for the heads up. |
@jeroenooms Apologies, I was trying to be consistent with the implementation in R's #ifdef STRICT_R_HEADERS
HL = static_cast<int*>(R_Calloc(n, int));
q = static_cast<double*>(R_Calloc(n, double));
#else
HL = static_cast<int*>(Calloc(n, int));
q = static_cast<double*>(Calloc(n, double));
#endif seemed to work, as I was able to compile |
Why can't you use stdlib malloc? |
Because it is data that may go back to R. But do a recursive grep (or my fav, |
My code reviews skills clearly need honing too. |
I have no idea what you're trying to do in |
@jeroenooms Again, trying to follow the conventions used in the R source, but I also got the impression from Writing R Extensions that these function were preferred to their stdlib counterparts:
However, if my interpretation of that passage is incorrect and you are confident that |
Hm, I could swear I had uses of To me either explicit prefix with |
Of course if it is really just temp storage then either |
@eddelbuettel Understood; I'll make these changes. |
@jeroenooms Just FYI this all goes back to the earlier and useful variant in RcppArmadillo which also stayed "close" to how R does things to offer a replacement. |
For some packages we need to
#define STRICT_R_HEADERS
because macros likeCalloc
,Free
andERROR
conflict with identically named macros in other libraries.This is working fine in Rcpp from CRAN, however in the development version of Rcpp I now get errors on Windows. It looks like a recent change in sugar/functions/sample.h has started using S-style
Calloc
andFree
instead of stdlibcalloc
andfree
.Is this intentional? It will break many packages that use
<Rcpp.h>
in conjunction withSTRICT_R_HEADERS
.The text was updated successfully, but these errors were encountered: