diff --git a/ChangeLog b/ChangeLog index 413eea9b5..504ec5c89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-23 Dirk Eddelbuettel + + * inst/include/Rcpp/Symbol.h: Use Rf_installChar(x) instead of + Rf_install(CHAR(X)) if R 3.2.0 or later is used + 2015-07-07 Qiang Kou * src/include/Rcpp/String.h: Ensure proper initialization of String diff --git a/DESCRIPTION b/DESCRIPTION index cd38b6892..442064372 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 0.11.6.4.2 -Date: 2015-07-21 +Version: 0.11.6.4.3 +Date: 2015-07-23 Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Douglas Bates, and John Chambers Maintainer: Dirk Eddelbuettel diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 5092f8b82..74b5eb413 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -24,6 +24,8 @@ request 322 and 329 by Qiang Kou) \item DataFrame constructors are now a little more careful (via pull request 301 by Romain Francois) + \item For R 3.2.0 or newer, \code{Rf_installChar()} is used instead of + \code{Rf_install(CHAR())}. } \item Changes in Rcpp Attributes: \itemize{ diff --git a/inst/include/Rcpp/Symbol.h b/inst/include/Rcpp/Symbol.h index d5c7eaed1..02b294df8 100644 --- a/inst/include/Rcpp/Symbol.h +++ b/inst/include/Rcpp/Symbol.h @@ -2,7 +2,7 @@ // // Symbol.h: Rcpp R/C++ interface class library -- access R environments // -// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2013 - 2015 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -43,13 +43,21 @@ namespace Rcpp{ Storage::set__( x ) ; break; /* nothing to do */ case CHARSXP: { + #if R_VERSION >= R_Version(3,2,0) + SEXP charSym = Rf_installChar(x); // R 3.2.0 or later have Rf_installChar + #else SEXP charSym = Rf_install(CHAR(x)); // cannot be gc()'ed once in symbol table + #endif Storage::set__( charSym ) ; break ; } case STRSXP: { /* FIXME: check that there is at least one element */ + #if R_VERSION >= R_Version(3,2,0) + SEXP charSym = Rf_installChar(STRING_ELT(x, 0 )); // R 3.2.0 or later have Rf_installChar + #else SEXP charSym = Rf_install( CHAR(STRING_ELT(x, 0 )) ); // cannot be gc()'ed once in symbol table + #endif Storage::set__( charSym ); break ; }