[Rcpp-commits] r3992 - in pkg/Rcpp: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 18 17:39:01 CET 2012


Author: jjallaire
Date: 2012-11-18 17:39:01 +0100 (Sun, 18 Nov 2012)
New Revision: 3992

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/TODO
   pkg/Rcpp/src/Attributes.cpp
Log:
include <Rcpp.h>above generated modules

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-11-18 16:32:11 UTC (rev 3991)
+++ pkg/Rcpp/ChangeLog	2012-11-18 16:39:01 UTC (rev 3992)
@@ -3,7 +3,8 @@
         * R/Attributes.R: sourceCpp embedded R code
         * src/AttributesParser.h: sourceCpp embedded R code
         * src/AttributesParser.cpp: sourceCpp embedded R code
-        * src/Attributes.cpp: sourceCpp embedded R code
+        * src/Attributes.cpp: sourceCpp embedded R code; include <Rcpp.h>
+        above generated modules
 
 2012-11-18  Romain Francois <romain at r-enthusiasts.com>
 

Modified: pkg/Rcpp/TODO
===================================================================
--- pkg/Rcpp/TODO	2012-11-18 16:32:11 UTC (rev 3991)
+++ pkg/Rcpp/TODO	2012-11-18 16:39:01 UTC (rev 3992)
@@ -147,8 +147,6 @@
     o   Typechecking on CppFunction calls so that seg-faults don't occur
         when passing incorrect types
 
-    o   Include <Rcpp.h> header above generated module in sourceCpp
-
     o   Clarify in 5.1 of vignette that attribute package features still
         require Makevars, etc. created by Rcpp.package.skeleton 
 

Modified: pkg/Rcpp/src/Attributes.cpp
===================================================================
--- pkg/Rcpp/src/Attributes.cpp	2012-11-18 16:32:11 UTC (rev 3991)
+++ pkg/Rcpp/src/Attributes.cpp	2012-11-18 16:39:01 UTC (rev 3992)
@@ -892,6 +892,7 @@
             generatedCpp_.clear();
             if (!sourceAttributes.empty()) {
                 std::ostringstream ostr;
+                ostr << "#include <Rcpp.h>" << std::endl;
                 ostr << "RCPP_MODULE(" << moduleName()  << ") {" << std::endl;
                 generateCppModuleFunctions(ostr, sourceAttributes, false);
                 ostr << "}" << std::endl;



More information about the Rcpp-commits mailing list