Skip to content

Commit 34997ab

Browse files
authored
Replace use of deprecated CLOENV with R_ClosureEnv if R >= 4.5.0 (closes #1360) (#1361)
* Use R_ClosureEnv instead of CLOENV with R (>= 4.5.0) * Roll micro version and date, update NEWS.Rd * Microcorrection to PR number in NEWS.Rd [ci skip]
1 parent b8d393a commit 34997ab

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

ChangeLog

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
2025-03-07 Dirk Eddelbuettel <edd@debian.org>
1+
2025-03-10 Dirk Eddelbuettel <edd@debian.org>
22

33
* DESCRIPTION (Version, Date): Roll micro version and date
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
2025-03-08 Dirk Eddelbuettel <edd@debian.org>
47

8+
* inst/include/Rcpp/Function.h: Use R_ClosureEnv instead of
9+
deprecated CLOENV if under R >= 4.5.0
10+
11+
2025-03-07 Dirk Eddelbuettel <edd@debian.org>
12+
13+
* DESCRIPTION (Version, Date): Roll micro version and date
514
* inst/include/Rcpp/config.h: Idem
615

716
* src/barrier.cpp (dataptr): Replace remaining DATAPTR with
@@ -21,7 +30,6 @@
2130
2025-02-05 Dirk Eddelbuettel <edd@debian.org>
2231

2332
* DESCRIPTION (Version, Date): Roll micro version and date
24-
2533
* inst/include/Rcpp/config.h: Idem
2634

2735
2025-01-31 Lev Kandel <lmakhlis@google.com>
@@ -36,7 +44,6 @@
3644
2025-01-26 Dirk Eddelbuettel <edd@debian.org>
3745

3846
* DESCRIPTION (Version, Date): Roll micro version and date
39-
4047
* inst/include/Rcpp/config.h: Idem
4148

4249
2025-01-25 Dirk Eddelbuettel <edd@debian.org>

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 1.0.14.4
4-
Date: 2025-03-07
3+
Version: 1.0.14.5
4+
Date: 2025-03-10
55
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org",
66
comment = c(ORCID = "0000-0001-6419-907X")),
77
person("Romain", "Francois", role = "aut",

inst/NEWS.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
\itemize{
1010
\item The \code{std::string_view} type is now covered by \code{wrap()}
1111
(Lev Kandel in \ghpr{1356} as discussed in \ghit{1357})
12+
\item A last remaining \code{DATAPTR} use has been converted to
13+
\code{DATAPTR_RO} (Dirk in \ghpr{1359})
14+
\item Under R 4.5.0 or later, \code{R_ClosureEnv} is used instead of
15+
\code{CLOENV} (Dirk in \ghpr{1361} fixing \ghpr{1360})
1216
}
1317
\item Changes in Rcpp Documentation:
1418
\itemize{

inst/include/Rcpp/Function.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ namespace Rcpp{
9999
if( TYPEOF(fun) != CLOSXP ) {
100100
throw not_a_closure(Rf_type2char(TYPEOF(fun)));
101101
}
102-
return CLOENV(fun) ;
102+
#if (defined(R_VERSION) && R_VERSION >= R_Version(4,5,0))
103+
return R_ClosureEnv(fun);
104+
#else
105+
return CLOENV(fun);
106+
#endif
103107
}
104108

105109
/**

inst/include/Rcpp/Symbol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Rcpp{
4343
Storage::set__( x ) ;
4444
break; /* nothing to do */
4545
case CHARSXP: {
46-
#if R_VERSION >= R_Version(3,2,0)
46+
#if R_VERSION >= R_Version(3,2,0)
4747
SEXP charSym = Rf_installChar(x); // R 3.2.0 or later have Rf_installChar
4848
#else
4949
SEXP charSym = Rf_install(CHAR(x)); // cannot be gc()'ed once in symbol table
@@ -53,7 +53,7 @@ namespace Rcpp{
5353
}
5454
case STRSXP: {
5555
/* FIXME: check that there is at least one element */
56-
#if R_VERSION >= R_Version(3,2,0)
56+
#if R_VERSION >= R_Version(3,2,0)
5757
SEXP charSym = Rf_installChar(STRING_ELT(x, 0 )); // R 3.2.0 or later have Rf_installChar
5858
#else
5959
SEXP charSym = Rf_install( CHAR(STRING_ELT(x, 0 )) ); // cannot be gc()'ed once in symbol table

inst/include/Rcpp/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define RCPP_VERSION_STRING "1.0.14"
3131

3232
// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
33-
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,4)
34-
#define RCPP_DEV_VERSION_STRING "1.0.14.4"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,5)
34+
#define RCPP_DEV_VERSION_STRING "1.0.14.5"
3535

3636
#endif

0 commit comments

Comments
 (0)