@@ -578,6 +578,7 @@ namespace attributes {
578578 const std::string& targetFile () const { return targetFile_; }
579579 const std::string& package () const { return package_; }
580580 const std::string& packageCpp () const { return packageCpp_; }
581+ const std::string packageCppPrefix () const { return " _" + packageCpp (); }
581582
582583 // Abstract interface for code generation
583584 virtual void writeBegin () = 0;
@@ -611,10 +612,10 @@ namespace attributes {
611612 return " RcppExport_validate" ;
612613 }
613614 std::string exportValidationFunctionRegisteredName () {
614- return packageCpp () + " _" + exportValidationFunction ();
615+ return packageCppPrefix () + " _" + exportValidationFunction ();
615616 }
616617 std::string registerCCallableExportedName () { // #nocov
617- return packageCpp () + " _RcppExport_registerCCallable" ; // #nocov
618+ return packageCppPrefix () + " _RcppExport_registerCCallable" ; // #nocov
618619 }
619620
620621 // Commit the stream -- is a no-op if the existing code is identical
@@ -1822,7 +1823,7 @@ namespace attributes {
18221823 // write header/preamble
18231824 std::ostringstream headerStream;
18241825 headerStream << commentPrefix_ << " Generated by using "
1825- << " Rcpp::compileAttributes()"
1826+ << " Rcpp::compileAttributes()"
18261827 << " -> do not edit by hand" << std::endl;
18271828 headerStream << commentPrefix_ << " Generator token: "
18281829 << generatorToken () << std::endl << std::endl;
@@ -1872,7 +1873,7 @@ namespace attributes {
18721873 attributes,
18731874 true ,
18741875 attributes.hasInterface (kInterfaceCpp ),
1875- packageCpp ());
1876+ packageCppPrefix ());
18761877
18771878 // track cppExports, signatures, and native routines (we use these
18781879 // at the end to generate the ValidateSignature and RegisterCCallable
@@ -1973,7 +1974,7 @@ namespace attributes {
19731974 std::vector<std::size_t > routineArgs;
19741975 for (std::size_t i=0 ;i<nativeRoutines_.size (); i++) {
19751976 const Attribute& attr = nativeRoutines_[i];
1976- routineNames.push_back (packageCpp () + " _" + attr.function ().name ());
1977+ routineNames.push_back (packageCppPrefix () + " _" + attr.function ().name ());
19771978 routineArgs.push_back (attr.function ().arguments ().size ());
19781979 }
19791980 std::string kRcppModuleBoot = " _rcpp_module_boot_" ;
@@ -2035,8 +2036,8 @@ namespace attributes {
20352036 std::ostringstream ostr;
20362037 std::string indentStr (indent, ' ' );
20372038 ostr << indentStr << " R_RegisterCCallable(\" " << package () << " \" , "
2038- << " \" " << packageCpp () << " _" << exportedName << " \" , "
2039- << " (DL_FUNC)" << packageCpp () << " _" << name << " );" ;
2039+ << " \" " << packageCppPrefix () << " _" << exportedName << " \" , "
2040+ << " (DL_FUNC)" << packageCppPrefix () << " _" << name << " );" ;
20402041 return ostr.str (); // #nocov end
20412042 }
20422043
@@ -2166,7 +2167,7 @@ namespace attributes {
21662167 << std::endl;
21672168 ostr () << " " << ptrName << " = "
21682169 << " (" << fnType << " )"
2169- << getCCallable (packageCpp () + " _" + function.name ()) << " ;"
2170+ << getCCallable (packageCppPrefix () + " _" + function.name ()) << " ;"
21702171 << std::endl;
21712172 ostr () << " }" << std::endl;
21722173 ostr () << " RObject rcpp_result_gen;" << std::endl;
@@ -2377,9 +2378,13 @@ namespace attributes {
23772378 ostr () << " .Call(" ;
23782379 if (!registration_)
23792380 ostr () << " '" ;
2380- ostr () << packageCpp () << " _" << function.name ();
2381+ else
2382+ ostr () << " `" ;
2383+ ostr () << packageCppPrefix () << " _" << function.name ();
23812384 if (!registration_)
23822385 ostr () << " ', " << " PACKAGE = '" << package () << " '" ;
2386+ else
2387+ ostr () << " `" ;
23832388
23842389 // add arguments
23852390 const std::vector<Argument>& arguments = function.arguments ();
@@ -2973,8 +2978,8 @@ namespace {
29732978 public:
29742979 SourceCppDynlib () {}
29752980
2976- SourceCppDynlib (const std::string& cacheDir,
2977- const std::string& cppSourcePath,
2981+ SourceCppDynlib (const std::string& cacheDir,
2982+ const std::string& cppSourcePath,
29782983 Rcpp::List platform)
29792984 : cppSourcePath_(cppSourcePath)
29802985
@@ -3336,7 +3341,7 @@ namespace {
33363341 Rcpp::Function dynlibLookupFunc = rcppEnv[" .sourceCppDynlibLookup" ];
33373342 Rcpp::List dynlibList = dynlibLookupFunc (cacheDir, file, code);
33383343 if (dynlibList.length () > 0 )
3339- return SourceCppDynlib (dynlibList);
3344+ return SourceCppDynlib (dynlibList);
33403345 else
33413346 return SourceCppDynlib ();
33423347 }
0 commit comments