[Rcpp-commits] r2647 - in pkg/Rcpp: . inst/unitTests src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 2 09:52:17 CET 2010
Author: romain
Date: 2010-12-02 09:52:16 +0100 (Thu, 02 Dec 2010)
New Revision: 2647
Modified:
pkg/Rcpp/DESCRIPTION
pkg/Rcpp/inst/unitTests/runit.RcppDate.R
pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R
pkg/Rcpp/inst/unitTests/runit.RcppMisc.R
pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R
pkg/Rcpp/src/RcppCommon.cpp
Log:
adding deprecation hooks (5)
Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/DESCRIPTION 2010-12-02 08:52:16 UTC (rev 2647)
@@ -1,6 +1,6 @@
Package: Rcpp
Title: Seamless R and C++ Integration
-Version: 0.8.9.1
+Version: 0.8.9.2
Date: $Date$
Author: Dirk Eddelbuettel and Romain Francois, with contributions
by Douglas Bates, John Chambers, Simon Urbanek, and David Reiss;
Modified: pkg/Rcpp/inst/unitTests/runit.RcppDate.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppDate.R 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/inst/unitTests/runit.RcppDate.R 2010-12-02 08:52:16 UTC (rev 2647)
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+if( Rcpp::capabilities()["classic api"] ){
+
.setUp <- function() {
if( ! exists( ".rcpp.RcppDate", globalenv() )) {
## definition of all the functions at once
@@ -130,3 +132,4 @@
checkEquals(as.numeric(fun()), as.numeric(as.POSIXct("2001-02-03 01:02:03.123456", tz="UTC")),
msg = "RcppDatetime.wrap")
}
+}
Modified: pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R 2010-12-02 08:52:16 UTC (rev 2647)
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+if( Rcpp::capabilities()["classic api"] ){
+
.setUp <- function() {
tests <- ".Rcpp.RcppMatrix"
@@ -260,6 +262,4 @@
checkEquals(fun(sv), sv[3], msg = "RcppStringVector.begin")
}
-
-
-
+}
Modified: pkg/Rcpp/inst/unitTests/runit.RcppMisc.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppMisc.R 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/inst/unitTests/runit.RcppMisc.R 2010-12-02 08:52:16 UTC (rev 2647)
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+if( Rcpp::capabilities()["classic api"] ){
+
.setUp <- function() {
tests <- ".Rcpp.RcppMisc"
@@ -144,3 +146,4 @@
result <- fun(list(val=posixt))[[1]]
checkTrue( (result-posixt) == 0.0 , msg = "RcppParams.getDatetimeValue")
}
+}
Modified: pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R 2010-12-02 08:52:16 UTC (rev 2647)
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+if( Rcpp::capabilities()["classic api"] ){
+
.setUp <- function() {
if( ! exists( ".rcpp.RcppResultSet", globalenv() )) {
## definition of all the functions at once
@@ -348,3 +350,5 @@
checkEquals( fun(x)[[1]], x, msg = "RcppResultSet.SEXP")
}
+}
+
Modified: pkg/Rcpp/src/RcppCommon.cpp
===================================================================
--- pkg/Rcpp/src/RcppCommon.cpp 2010-12-02 08:49:47 UTC (rev 2646)
+++ pkg/Rcpp/src/RcppCommon.cpp 2010-12-02 08:52:16 UTC (rev 2647)
@@ -30,8 +30,8 @@
}
SEXP capabilities(){
- SEXP cap = PROTECT( Rf_allocVector( LGLSXP, 7) ) ;
- SEXP names = PROTECT( Rf_allocVector( STRSXP, 7 ) ) ;
+ SEXP cap = PROTECT( Rf_allocVector( LGLSXP, 8) ) ;
+ SEXP names = PROTECT( Rf_allocVector( STRSXP, 8 ) ) ;
#ifdef HAS_VARIADIC_TEMPLATES
LOGICAL(cap)[0] = TRUE ;
#else
@@ -65,6 +65,12 @@
LOGICAL(cap)[6] = FALSE ;
#endif
+#ifdef RCPP_NO_CLASSIC_API
+ LOGICAL(cap)[7] = FALSE ;
+#else
+ LOGICAL(cap)[8] = TRUE ;
+#endif
+
SET_STRING_ELT(names, 0, Rf_mkChar("variadic templates") ) ;
SET_STRING_ELT(names, 1, Rf_mkChar("initializer lists") ) ;
SET_STRING_ELT(names, 2, Rf_mkChar("exception handling") ) ;
@@ -72,6 +78,7 @@
SET_STRING_ELT(names, 4, Rf_mkChar("tr1 unordered sets") ) ;
SET_STRING_ELT(names, 5, Rf_mkChar("Rcpp modules") ) ;
SET_STRING_ELT(names, 6, Rf_mkChar("demangling") ) ;
+ SET_STRING_ELT(names, 6, Rf_mkChar("classic api") ) ;
Rf_setAttrib( cap, R_NamesSymbol, names ) ;
UNPROTECT(2) ;
return cap ;
More information about the Rcpp-commits
mailing list