Skip to content

Commit e3d75bf

Browse files
committed
protect use of RCPP_NO_MASK in attributes
1 parent 518f6fe commit e3d75bf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ RcppExport SEXP _testRcppInterfaceExporter_test_cpp_interface(SEXP xSEXP, SEXP f
4343
if (rcpp_isError_gen) {
4444
SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
4545
UNPROTECT(1);
46+
#ifdef RCPP_NO_MASK
4647
RCPP_NO_MASK(Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
48+
#else
49+
Rf_error("%s", CHAR(rcpp_msgSEXP_gen));
50+
#endif
4751
}
4852
UNPROTECT(1);
4953
return rcpp_result_gen;

src/attributes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,11 @@ namespace attributes {
29532953
<< " if (rcpp_isError_gen) {" << std::endl
29542954
<< " SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);" << std::endl
29552955
<< " UNPROTECT(1);" << std::endl
2956+
<< " #ifdef RCPP_NO_MASK" << std::endl
29562957
<< " RCPP_NO_MASK(Rf_error)(\"%s\", CHAR(rcpp_msgSEXP_gen));" << std::endl
2958+
<< " #else" << std::endl
2959+
<< " Rf_error(\"%s\", CHAR(rcpp_msgSEXP_gen));" << std::endl
2960+
<< " #endif" << std::endl
29572961
<< " }" << std::endl
29582962
<< " UNPROTECT(1);" << std::endl
29592963
<< " return rcpp_result_gen;" << std::endl

0 commit comments

Comments
 (0)