Skip to content

Commit af38407

Browse files
authored
Merge branch 'master' into feature/more_tests
2 parents a694ed2 + 4e987f9 commit af38407

File tree

7 files changed

+60
-20
lines changed

7 files changed

+60
-20
lines changed

ChangeLog

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2026-01-23 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/DataFrame.h (nrow): Use R_nrow() with R >= 4.6.0
4+
* inst/include/Rcpp/proxy/AttributeProxy.h (attributeNames): Use
5+
R_getAttribNames() with R >= 4.6.0;
6+
* inst/include/Rcpp/proxy/AttributeProxy.h (hasAttribute): Use
7+
R_hasAttrib with R >= 4.6.0
8+
9+
2026-01-22 Dirk Eddelbuettel <edd@debian.org>
10+
11+
* DESCRIPTION (Version, Date): Roll micro version and date
12+
* inst/include/Rcpp/config.h: Idem
13+
14+
2026-01-21 Dirk Eddelbuettel <edd@debian.org>
15+
16+
* inst/include/Rcpp/date_datetime/Datetime.h: Fractional seconds type
17+
switched to 'int' for consistency, print format string re-adjusted
18+
19+
2026-01-20 Dirk Eddelbuettel <edd@debian.org>
20+
21+
* inst/include/Rcpp/date_datetime/Datetime.h (format): Correct a
22+
format string reflecting 'unsigned int' rather than 'int'
23+
124
2026-01-13 Dirk Eddelbuettel <edd@debian.org>
225

326
* inst/tinytest/cpp/attributes_extended.cpp: New unit tests

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.1.1.1
4-
Date: 2026-01-12
3+
Version: 1.1.1.3
4+
Date: 2026-01-23
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}
55

6+
\section{Changes in Rcpp release version 1.1.2 [unreleased] (expected 2026-07-xx)}{
7+
\itemize{
8+
\item Changes in Rcpp API:
9+
\itemize{
10+
\item Use of \code{execinfo.h} is again conditional to avoid build
11+
complexity (Dirk in \ghpr{1445} addressing \ghit{1442})
12+
\item An internal state component for \code{Datetime} is now \code{int}
13+
(Dirk in \ghpr{1448} and \ghpr{1449} fixing \ghpr{1447})
14+
\item Three new (in R 4.6.0) attribute accessors are used conditionally
15+
(Dirk in \ghpr{1450} closing \ghit{1432})
16+
}
17+
}
18+
}
19+
620
\section{Changes in Rcpp release version 1.1.1 (2026-01-08)}{
721
\itemize{
822
\item Changes in Rcpp API:

inst/include/Rcpp/DataFrame.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2-
//
1+
32
// DataFrame.h: Rcpp R/C++ interface class library -- data frames
43
//
5-
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of Rcpp.
87
//
@@ -67,8 +66,12 @@ namespace Rcpp{
6766
// discussed in #1430 is also possible and preferable. We also switch
6867
// to returning R_xlen_t which as upcast from int is safe
6968
inline R_xlen_t nrow() const {
69+
#if R_VERSION < R_Version(4,6,0)
7070
Shield<SEXP> rn{Rf_getAttrib(Parent::get__(), R_RowNamesSymbol)};
7171
return Rf_xlength(rn);
72+
#else
73+
return R_nrow(Parent::get__());
74+
#endif
7275
}
7376

7477
template <typename T>

inst/include/Rcpp/config.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

2-
32
// config.h: Rcpp R/C++ interface class library -- Rcpp configuration
43
//
5-
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of Rcpp.
87
//
@@ -31,7 +30,7 @@
3130
#define RCPP_VERSION_STRING "1.1.1"
3231

3332
// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
34-
#define RCPP_DEV_VERSION RcppDevVersion(1,1,1,1)
35-
#define RCPP_DEV_VERSION_STRING "1.1.1.1"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,1,1,3)
34+
#define RCPP_DEV_VERSION_STRING "1.1.1.3"
3635

3736
#endif

inst/include/Rcpp/date_datetime/Datetime.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2-
//
1+
32
// Datetime.h: Rcpp R/C++ interface class library -- Datetime (POSIXct)
43
//
5-
// Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois
4+
// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
65
//
76
// This file is part of Rcpp.
87
//
@@ -94,7 +93,7 @@ namespace Rcpp {
9493
private:
9594
double m_dt; // fractional seconds since epoch
9695
struct tm m_tm; // standard time representation
97-
unsigned int m_us; // microsecond (to complement m_tm)
96+
int m_us; // microsecond (to complement m_tm)
9897

9998
// update m_tm based on m_dt
10099
void update_tm() {

inst/include/Rcpp/proxy/AttributeProxy.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@ class AttributeProxyPolicy {
8080
std::vector<std::string> attributeNames() const {
8181
std::vector<std::string> v;
8282
#if R_VERSION >= R_Version(4, 6, 0)
83-
auto visitor = [](SEXP name, SEXP attr, void* data) -> SEXP {
84-
std::vector<std::string>* ptr = static_cast<std::vector<std::string>*>(data);
85-
std::string s{CHAR(Rf_asChar(name))};
86-
ptr->push_back(s);
87-
return NULL;
88-
};
89-
R_mapAttrib(static_cast<const CLASS&>(*this).get__(), visitor, static_cast<void*>(&v));
83+
SEXP attrs = R_getAttribNames( static_cast<const CLASS&>(*this));
84+
R_xlen_t n = XLENGTH(attrs);
85+
for (R_xlen_t i = 0; i < n; i++) {
86+
v.push_back(std::string(CHAR(STRING_ELT(attrs, i))));
87+
}
9088
#else
9189
SEXP attrs = ATTRIB( static_cast<const CLASS&>(*this).get__());
9290
while( attrs != R_NilValue ){
@@ -98,7 +96,11 @@ class AttributeProxyPolicy {
9896
}
9997

10098
bool hasAttribute(const std::string& attr) const {
99+
#if R_VERSION >= R_Version(4, 6, 0)
100+
return R_hasAttrib(static_cast<const CLASS&>(*this).get__(), Rf_install(attr.c_str()));
101+
#else
101102
return static_cast<const CLASS&>(*this).attr(attr) != R_NilValue;
103+
#endif
102104
}
103105

104106

0 commit comments

Comments
 (0)