Skip to content

Commit b8d393a

Browse files
authored
Convert remaining DATAPTR to DATAPTR_RO (#1359)
* Use DATAPTR_RO in barrier.cpp * Roll micro version and date
1 parent 165f82f commit b8d393a

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2025-03-07 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll micro version and date
4+
5+
* inst/include/Rcpp/config.h: Idem
6+
7+
* src/barrier.cpp (dataptr): Replace remaining DATAPTR with
8+
DATAPTR_RO for suitable R greater than 3.5.0
9+
110
2025-02-11 Dirk Eddelbuettel <[email protected]>
211

312
* R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Support optional

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.3
4-
Date: 2025-02-11
3+
Version: 1.0.14.4
4+
Date: 2025-03-07
55
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
66
comment = c(ORCID = "0000-0001-6419-907X")),
77
person("Romain", "Francois", role = "aut",

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,3)
34-
#define RCPP_DEV_VERSION_STRING "1.0.14.3"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,4)
34+
#define RCPP_DEV_VERSION_STRING "1.0.14.4"
3535

3636
#endif

src/barrier.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ SEXP* get_vector_ptr(SEXP x) {
7676

7777
// [[Rcpp::register]]
7878
void* dataptr(SEXP x) {
79+
#if R_VERSION >= R_Version(3,5,0)
80+
// DATAPTR_RO was introduced with R 3.5.0
81+
return const_cast<void*>(DATAPTR_RO(x));
82+
#else
83+
// this will get your wrists slapped under recent R CMD check ...
7984
return DATAPTR(x);
85+
#endif
8086
}
8187

8288
// [[Rcpp::register]]

0 commit comments

Comments
 (0)