@@ -578,6 +578,7 @@ namespace attributes {
578
578
const std::string& targetFile () const { return targetFile_; }
579
579
const std::string& package () const { return package_; }
580
580
const std::string& packageCpp () const { return packageCpp_; }
581
+ const std::string packageCppPrefix () const { return " _" + packageCpp (); }
581
582
582
583
// Abstract interface for code generation
583
584
virtual void writeBegin () = 0;
@@ -611,10 +612,10 @@ namespace attributes {
611
612
return " RcppExport_validate" ;
612
613
}
613
614
std::string exportValidationFunctionRegisteredName () {
614
- return packageCpp () + " _" + exportValidationFunction ();
615
+ return packageCppPrefix () + " _" + exportValidationFunction ();
615
616
}
616
617
std::string registerCCallableExportedName () { // #nocov
617
- return packageCpp () + " _RcppExport_registerCCallable" ; // #nocov
618
+ return packageCppPrefix () + " _RcppExport_registerCCallable" ; // #nocov
618
619
}
619
620
620
621
// Commit the stream -- is a no-op if the existing code is identical
@@ -1822,7 +1823,7 @@ namespace attributes {
1822
1823
// write header/preamble
1823
1824
std::ostringstream headerStream;
1824
1825
headerStream << commentPrefix_ << " Generated by using "
1825
- << " Rcpp::compileAttributes()"
1826
+ << " Rcpp::compileAttributes()"
1826
1827
<< " -> do not edit by hand" << std::endl;
1827
1828
headerStream << commentPrefix_ << " Generator token: "
1828
1829
<< generatorToken () << std::endl << std::endl;
@@ -1872,7 +1873,7 @@ namespace attributes {
1872
1873
attributes,
1873
1874
true ,
1874
1875
attributes.hasInterface (kInterfaceCpp ),
1875
- packageCpp ());
1876
+ packageCppPrefix ());
1876
1877
1877
1878
// track cppExports, signatures, and native routines (we use these
1878
1879
// at the end to generate the ValidateSignature and RegisterCCallable
@@ -1973,7 +1974,7 @@ namespace attributes {
1973
1974
std::vector<std::size_t > routineArgs;
1974
1975
for (std::size_t i=0 ;i<nativeRoutines_.size (); i++) {
1975
1976
const Attribute& attr = nativeRoutines_[i];
1976
- routineNames.push_back (packageCpp () + " _" + attr.function ().name ());
1977
+ routineNames.push_back (packageCppPrefix () + " _" + attr.function ().name ());
1977
1978
routineArgs.push_back (attr.function ().arguments ().size ());
1978
1979
}
1979
1980
std::string kRcppModuleBoot = " _rcpp_module_boot_" ;
@@ -2035,8 +2036,8 @@ namespace attributes {
2035
2036
std::ostringstream ostr;
2036
2037
std::string indentStr (indent, ' ' );
2037
2038
ostr << indentStr << " R_RegisterCCallable(\" " << package () << " \" , "
2038
- << " \" " << packageCpp () << " _" << exportedName << " \" , "
2039
- << " (DL_FUNC)" << packageCpp () << " _" << name << " );" ;
2039
+ << " \" " << packageCppPrefix () << " _" << exportedName << " \" , "
2040
+ << " (DL_FUNC)" << packageCppPrefix () << " _" << name << " );" ;
2040
2041
return ostr.str (); // #nocov end
2041
2042
}
2042
2043
@@ -2166,7 +2167,7 @@ namespace attributes {
2166
2167
<< std::endl;
2167
2168
ostr () << " " << ptrName << " = "
2168
2169
<< " (" << fnType << " )"
2169
- << getCCallable (packageCpp () + " _" + function.name ()) << " ;"
2170
+ << getCCallable (packageCppPrefix () + " _" + function.name ()) << " ;"
2170
2171
<< std::endl;
2171
2172
ostr () << " }" << std::endl;
2172
2173
ostr () << " RObject rcpp_result_gen;" << std::endl;
@@ -2377,9 +2378,13 @@ namespace attributes {
2377
2378
ostr () << " .Call(" ;
2378
2379
if (!registration_)
2379
2380
ostr () << " '" ;
2380
- ostr () << packageCpp () << " _" << function.name ();
2381
+ else
2382
+ ostr () << " `" ;
2383
+ ostr () << packageCppPrefix () << " _" << function.name ();
2381
2384
if (!registration_)
2382
2385
ostr () << " ', " << " PACKAGE = '" << package () << " '" ;
2386
+ else
2387
+ ostr () << " `" ;
2383
2388
2384
2389
// add arguments
2385
2390
const std::vector<Argument>& arguments = function.arguments ();
@@ -2973,8 +2978,8 @@ namespace {
2973
2978
public:
2974
2979
SourceCppDynlib () {}
2975
2980
2976
- SourceCppDynlib (const std::string& cacheDir,
2977
- const std::string& cppSourcePath,
2981
+ SourceCppDynlib (const std::string& cacheDir,
2982
+ const std::string& cppSourcePath,
2978
2983
Rcpp::List platform)
2979
2984
: cppSourcePath_(cppSourcePath)
2980
2985
@@ -3336,7 +3341,7 @@ namespace {
3336
3341
Rcpp::Function dynlibLookupFunc = rcppEnv[" .sourceCppDynlibLookup" ];
3337
3342
Rcpp::List dynlibList = dynlibLookupFunc (cacheDir, file, code);
3338
3343
if (dynlibList.length () > 0 )
3339
- return SourceCppDynlib (dynlibList);
3344
+ return SourceCppDynlib (dynlibList);
3340
3345
else
3341
3346
return SourceCppDynlib ();
3342
3347
}
0 commit comments