File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1+ 2015-10-01 JJ Allaire <jj@rstudio.org>
2+
3+ * src/attributes.cpp: Avoid invalid function names when
4+ generating C++ interfaces.
5+
162015-11-14 Dirk Eddelbuettel <edd@debian.org>
27
38 * DESCRIPTION: Release 0.12.2
Original file line number Diff line number Diff line change 33\newcommand {\ghpr }{\href {https : // github.com / RcppCore / Rcpp / pull / # 1}{##1}}
44\newcommand {\ghit }{\href {https : // github.com / RcppCore / Rcpp / issues / # 1}{##1}}
55
6+ \section {Changes in Rcpp version 0.12.3 (Unreleased )}{
7+ \itemize {
8+ \item Changes in Rcpp Attributes :
9+ \itemize {
10+ \item Avoid invalid function names when generating C ++ interfaces.
11+ }
12+ }
13+ }
14+
615\section {Changes in Rcpp version 0.12.2 (2015 - 11 - 14 )}{
716 \itemize {
817 \item Changes in Rcpp API :
Original file line number Diff line number Diff line change @@ -343,6 +343,12 @@ namespace attributes {
343343 return function ().name ();
344344 }
345345 }
346+
347+ std::string exportedCppName () const {
348+ std::string name = exportedName ();
349+ std::replace (name.begin (), name.end (), ' .' , ' _' );
350+ return name;
351+ }
346352
347353 bool rng () const {
348354 Param rngParam = paramNamed (kExportRng );
@@ -1795,7 +1801,7 @@ namespace attributes {
17951801 it = attributes.begin (); it != attributes.end (); ++it) {
17961802 if (it->isExportedFunction ()) {
17971803 // add it to the list if it's not hidden
1798- Function fun = it->function ().renamedTo (it->exportedName ());
1804+ Function fun = it->function ().renamedTo (it->exportedCppName ());
17991805 if (!fun.isHidden ())
18001806 cppExports_.push_back (*it);
18011807 }
@@ -1978,7 +1984,7 @@ namespace attributes {
19781984 if (it->isExportedFunction ()) {
19791985
19801986 Function function =
1981- it->function ().renamedTo (it->exportedName ());
1987+ it->function ().renamedTo (it->exportedCppName ());
19821988
19831989 // if it's hidden then don't generate a C++ interface
19841990 if (function.isHidden ())
You can’t perform that action at this time.
0 commit comments