@@ -1772,8 +1772,9 @@ namespace attributes {
1772
1772
1773
1773
// write header/preamble
1774
1774
std::ostringstream headerStream;
1775
- headerStream << commentPrefix_ << " This file was generated by "
1776
- << " Rcpp::compileAttributes" << std::endl;
1775
+ headerStream << commentPrefix_ << " Generated by using "
1776
+ << " Rcpp::compileAttributes()"
1777
+ << " -> do not edit by hand" << std::endl;
1777
1778
headerStream << commentPrefix_ << " Generator token: "
1778
1779
<< generatorToken () << std::endl << std::endl;
1779
1780
if (!preamble.empty ())
@@ -2045,11 +2046,11 @@ namespace attributes {
2045
2046
<< getCCallable (packageCpp () + " _" + function.name ()) << " ;"
2046
2047
<< std::endl;
2047
2048
ostr () << " }" << std::endl;
2048
- ostr () << " RObject __result ;" << std::endl;
2049
+ ostr () << " RObject rcpp_result_gen ;" << std::endl;
2049
2050
ostr () << " {" << std::endl;
2050
2051
if (it->rng ())
2051
- ostr () << " RNGScope __rngScope ;" << std::endl;
2052
- ostr () << " __result = " << ptrName << " (" ;
2052
+ ostr () << " RNGScope RCPP_rngScope_gen ;" << std::endl;
2053
+ ostr () << " rcpp_result_gen = " << ptrName << " (" ;
2053
2054
2054
2055
const std::vector<Argument>& args = function.arguments ();
2055
2056
for (std::size_t i = 0 ; i<args.size (); i++) {
@@ -2061,18 +2062,18 @@ namespace attributes {
2061
2062
ostr () << " );" << std::endl;
2062
2063
ostr () << " }" << std::endl;
2063
2064
2064
- ostr () << " if (__result .inherits(\" interrupted-error\" ))"
2065
+ ostr () << " if (rcpp_result_gen .inherits(\" interrupted-error\" ))"
2065
2066
<< std::endl
2066
2067
<< " throw Rcpp::internal::InterruptedException();"
2067
2068
<< std::endl;
2068
- ostr () << " if (__result .inherits(\" try-error\" ))"
2069
+ ostr () << " if (rcpp_result_gen .inherits(\" try-error\" ))"
2069
2070
<< std::endl
2070
2071
<< " throw Rcpp::exception(as<std::string>("
2071
- << " __result ).c_str());"
2072
+ << " rcpp_result_gen ).c_str());"
2072
2073
<< std::endl;
2073
2074
if (!function.type ().isVoid ()) {
2074
2075
ostr () << " return Rcpp::as<" << function.type () << " >"
2075
- << " (__result );" << std::endl;
2076
+ << " (rcpp_result_gen );" << std::endl;
2076
2077
}
2077
2078
2078
2079
ostr () << " }" << std::endl << std::endl;
@@ -2148,7 +2149,7 @@ namespace attributes {
2148
2149
}
2149
2150
2150
2151
std::string CppExportsIncludeGenerator::getHeaderGuard () const {
2151
- return " __ " + packageCpp () + " _RcppExports_h__ " ;
2152
+ return " _RCPP_ " + packageCpp () + " _RCPPEXPORTS_H_GEN_ " ;
2152
2153
}
2153
2154
2154
2155
CppPackageIncludeGenerator::CppPackageIncludeGenerator (
@@ -2196,7 +2197,7 @@ namespace attributes {
2196
2197
}
2197
2198
2198
2199
std::string CppPackageIncludeGenerator::getHeaderGuard () const {
2199
- return " __ " + packageCpp () + " _h__ " ;
2200
+ return " _RCPP_ " + packageCpp () + " _H_GEN_ " ;
2200
2201
}
2201
2202
2202
2203
RExportsGenerator::RExportsGenerator (const std::string& packageDir,
@@ -2582,9 +2583,9 @@ namespace attributes {
2582
2583
ostr << args << " ) {" << std::endl;
2583
2584
ostr << " BEGIN_RCPP" << std::endl;
2584
2585
if (!function.type ().isVoid ())
2585
- ostr << " Rcpp::RObject __result ;" << std::endl;
2586
+ ostr << " Rcpp::RObject rcpp_result_gen ;" << std::endl;
2586
2587
if (!cppInterface && attribute.rng ())
2587
- ostr << " Rcpp::RNGScope __rngScope ;" << std::endl;
2588
+ ostr << " Rcpp::RNGScope rcpp_rngScope_gen ;" << std::endl;
2588
2589
for (size_t i = 0 ; i<arguments.size (); i++) {
2589
2590
const Argument& argument = arguments[i];
2590
2591
@@ -2595,7 +2596,7 @@ namespace attributes {
2595
2596
2596
2597
ostr << " " ;
2597
2598
if (!function.type ().isVoid ())
2598
- ostr << " __result = Rcpp::wrap(" ;
2599
+ ostr << " rcpp_result_gen = Rcpp::wrap(" ;
2599
2600
ostr << function.name () << " (" ;
2600
2601
for (size_t i = 0 ; i<arguments.size (); i++) {
2601
2602
const Argument& argument = arguments[i];
@@ -2609,7 +2610,7 @@ namespace attributes {
2609
2610
2610
2611
if (!function.type ().isVoid ())
2611
2612
{
2612
- ostr << " return __result ;" << std::endl;
2613
+ ostr << " return rcpp_result_gen ;" << std::endl;
2613
2614
}
2614
2615
else
2615
2616
{
@@ -2623,11 +2624,11 @@ namespace attributes {
2623
2624
if (cppInterface) {
2624
2625
ostr << " RcppExport SEXP " << funcName << " (" << args << " ) {"
2625
2626
<< std::endl;
2626
- ostr << " SEXP __result ;" << std::endl;
2627
+ ostr << " SEXP rcpp_result_gen ;" << std::endl;
2627
2628
ostr << " {" << std::endl;
2628
2629
if (attribute.rng ())
2629
- ostr << " Rcpp::RNGScope __rngScope ;" << std::endl;
2630
- ostr << " __result = PROTECT(" << funcName
2630
+ ostr << " Rcpp::RNGScope rcpp_rngScope_gen ;" << std::endl;
2631
+ ostr << " rcpp_result_gen = PROTECT(" << funcName
2631
2632
<< kTrySuffix << " (" ;
2632
2633
for (size_t i = 0 ; i<arguments.size (); i++) {
2633
2634
const Argument& argument = arguments[i];
@@ -2637,21 +2638,21 @@ namespace attributes {
2637
2638
}
2638
2639
ostr << " ));" << std::endl;
2639
2640
ostr << " }" << std::endl;
2640
- ostr << " Rboolean __isInterrupt = Rf_inherits(__result , \" interrupted-error\" );"
2641
+ ostr << " Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen , \" interrupted-error\" );"
2641
2642
<< std::endl
2642
- << " if (__isInterrupt ) {" << std::endl
2643
+ << " if (rcpp_isError_gen ) {" << std::endl
2643
2644
<< " UNPROTECT(1);" << std::endl
2644
2645
<< " Rf_onintr();" << std::endl
2645
2646
<< " }" << std::endl
2646
- << " Rboolean __isError = Rf_inherits(__result , \" try-error\" );"
2647
+ << " Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen , \" try-error\" );"
2647
2648
<< std::endl
2648
- << " if (__isError ) {" << std::endl
2649
- << " SEXP __msgSEXP = Rf_asChar(__result );" << std::endl
2649
+ << " if (rcpp_isError_gen ) {" << std::endl
2650
+ << " SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen );" << std::endl
2650
2651
<< " UNPROTECT(1);" << std::endl
2651
- << " Rf_error(CHAR(__msgSEXP ));" << std::endl
2652
+ << " Rf_error(CHAR(rcpp_msgSEXP_gen ));" << std::endl
2652
2653
<< " }" << std::endl
2653
2654
<< " UNPROTECT(1);" << std::endl
2654
- << " return __result ;" << std::endl
2655
+ << " return rcpp_result_gen ;" << std::endl
2655
2656
<< " }" << std::endl;
2656
2657
}
2657
2658
}
0 commit comments