Skip to content

Commit 0a2f3a3

Browse files
committed
Remove RCPP_USING_CXX11 which is now implicit
1 parent 82c4c5f commit 0a2f3a3

File tree

8 files changed

+20
-59
lines changed

8 files changed

+20
-59
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2025-03-21 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/String.h: Remove explicit RCPP_USING_CXX11 as
4+
use of C++11 (or newer) is both implicit and ensuredIdem
5+
* inst/include/Rcpp/macros/dispatch.h: Idem
6+
* inst/include/Rcpp/platform/compiler.h: Idem
7+
* inst/include/Rcpp/unwindProtect.h: Idem
8+
* inst/tinytest/cpp/wrap.cpp: Idem
9+
* src/api.cpp: Idem
10+
111
2025-03-18 Dirk Eddelbuettel <[email protected]>
212

313
* DESCRIPTION (Version, Date): Roll micro version and date

inst/NEWS.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
\item Changes in Rcpp Deployment:
3131
\itemize{
3232
\item \code{Rcpp.package.skeleton()} creates \sQuote{URL} and
33-
\sQuote{BugReports} if given a GitHub username (Dirk \ghpr{1358})
33+
\sQuote{BugReports} if given a GitHub username (Dirk in \ghpr{1358})
3434
}
3535
}
3636
}

inst/include/Rcpp/String.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// String.h: Rcpp R/C++ interface class library -- single string
33
//
44
// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois
5-
// Copyright (C) 2021 - 2023 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
5+
// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
66
//
77
// This file is part of Rcpp.
88
//
@@ -117,7 +117,7 @@ namespace Rcpp {
117117
String(const std::string& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) {
118118
RCPP_STRING_DEBUG("String(const std::string&, cetype_t)");
119119
}
120-
#ifdef RCPP_USING_CXX11
120+
121121
/** move constructor */
122122
String(String&& s) : data(s.data), token(s.token), buffer(std::move(s.buffer)), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) {
123123
// Erase s.
@@ -134,7 +134,7 @@ namespace Rcpp {
134134
String(std::string&& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) {
135135
RCPP_STRING_DEBUG("String(std::string&&, cetype_t)");
136136
}
137-
#endif
137+
138138
String(const std::wstring& s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) {
139139
token = Rcpp_PreciousPreserve(data);
140140
RCPP_STRING_DEBUG("String(const std::wstring&, cetype_t)");
@@ -267,7 +267,6 @@ namespace Rcpp {
267267
buffer_ready = true;
268268
return *this;
269269
}
270-
#ifdef RCPP_USING_CXX11
271270
inline String& operator=(String&& other) {
272271
data = other.data;
273272
token = other.token;
@@ -290,7 +289,6 @@ namespace Rcpp {
290289
buffer_ready = true;
291290
return *this;
292291
}
293-
#endif
294292
inline String& operator=(const char* s) {
295293
buffer = s;
296294
valid = false;

inst/include/Rcpp/macros/dispatch.h

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// dispatch.h: Rcpp R/C++ interface class library -- macros for dispatch
44
//
55
// Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
6-
// Copyright (C) 2016 Dirk Eddelbuettel, Romain Francois, Artem Klevtsov and Nathan Russell
6+
// Copyright (C) 2016 - 2025 Dirk Eddelbuettel, Romain Francois, Artem Klevtsov and Nathan Russell
77
//
88
// This file is part of Rcpp.
99
//
@@ -23,15 +23,13 @@
2323
#ifndef Rcpp__macros__dispatch_h
2424
#define Rcpp__macros__dispatch_h
2525

26-
// The variadic macros below incorporate techniques presented by
26+
// The variadic macros below incorporate techniques presented by
2727
// Stack Overflow user Richard Hansen in this answer
2828
//
29-
// http://stackoverflow.com/a/11172679/1869097
29+
// http://stackoverflow.com/a/11172679/1869097
3030
//
3131
// and are necessary to avoid the use of GNU compiler extensions.
3232

33-
#ifdef RCPP_USING_CXX11
34-
3533
#define ___RCPP_HANDLE_CASE___(___RTYPE___, ___FUN___, ___RCPPTYPE___, ...) \
3634
case ___RTYPE___: \
3735
return ___FUN___(::Rcpp::___RCPPTYPE___<___RTYPE___>(RCPP_MACRO_FIRST(__VA_ARGS__)) \
@@ -77,32 +75,4 @@
7775
#define RCPP_MACRO_SELECT_25TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, \
7876
a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, ...) a25
7977

80-
#else
81-
82-
#define ___RCPP_HANDLE_CASE___(___RTYPE___, ___FUN___, ___OBJECT___, \
83-
___RCPPTYPE___) \
84-
case ___RTYPE___: \
85-
return ___FUN___(::Rcpp::___RCPPTYPE___<___RTYPE___>(___OBJECT___));
86-
87-
#define ___RCPP_RETURN___(__FUN__, __SEXP__, __RCPPTYPE__) \
88-
SEXP __TMP__ = __SEXP__; \
89-
switch (TYPEOF(__TMP__)) { \
90-
___RCPP_HANDLE_CASE___(INTSXP, __FUN__, __TMP__, __RCPPTYPE__) \
91-
___RCPP_HANDLE_CASE___(REALSXP, __FUN__, __TMP__, __RCPPTYPE__) \
92-
___RCPP_HANDLE_CASE___(RAWSXP, __FUN__, __TMP__, __RCPPTYPE__) \
93-
___RCPP_HANDLE_CASE___(LGLSXP, __FUN__, __TMP__, __RCPPTYPE__) \
94-
___RCPP_HANDLE_CASE___(CPLXSXP, __FUN__, __TMP__, __RCPPTYPE__) \
95-
___RCPP_HANDLE_CASE___(STRSXP, __FUN__, __TMP__, __RCPPTYPE__) \
96-
___RCPP_HANDLE_CASE___(VECSXP, __FUN__, __TMP__, __RCPPTYPE__) \
97-
___RCPP_HANDLE_CASE___(EXPRSXP, __FUN__, __TMP__, __RCPPTYPE__) \
98-
default: \
99-
throw std::range_error("Not a vector"); \
100-
}
101-
102-
#define RCPP_RETURN_VECTOR(_FUN_, _SEXP_) \
103-
___RCPP_RETURN___(_FUN_, _SEXP_, Vector)
104-
#define RCPP_RETURN_MATRIX(_FUN_, _SEXP_) \
105-
___RCPP_RETURN___(_FUN_, _SEXP_, Matrix)
106-
#endif
107-
10878
#endif

inst/include/Rcpp/platform/compiler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
// C++11 features -- that used to be carefully tested for or worked around via CXX0X / TR1
3535
// These defines are all planned to get removed just how a number have already been removed. One at a time...
36-
#define RCPP_USING_CXX11
3736
#include <cmath>
3837
#include <initializer_list>
3938
#include <unordered_map>

inst/include/Rcpp/unwindProtect.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// unwind.h: Rcpp R/C++ interface class library -- Unwind Protect
33
//
44
// Copyright (C) 2018 - 2020 RStudio
5-
// Copyright (C) 2021 RStudio, Dirk Eddelbuettel and Iñaki Ucar
5+
// Copyright (C) 2021 - 2025 RStudio, Dirk Eddelbuettel and Iñaki Ucar
66
//
77
// This file is part of Rcpp.
88
//
@@ -23,11 +23,7 @@
2323
#define RCPP_UNWINDPROTECT_H
2424

2525
#include <csetjmp>
26-
27-
#ifdef RCPP_USING_CXX11
2826
#include <functional>
29-
#endif
30-
3127

3228
namespace Rcpp { namespace internal {
3329

@@ -45,12 +41,10 @@ inline void maybeJump(void* unwind_data, Rboolean jump) {
4541
}
4642
}
4743

48-
#ifdef RCPP_USING_CXX11
4944
inline SEXP unwindProtectUnwrap(void* data) {
5045
std::function<SEXP(void)>* callback = (std::function<SEXP(void)>*) data;
5146
return (*callback)();
5247
}
53-
#endif
5448

5549
}} // namespace Rcpp::internal
5650

@@ -76,11 +70,9 @@ inline SEXP unwindProtect(SEXP (*callback)(void* data), void* data) {
7670
token);
7771
}
7872

79-
#ifdef RCPP_USING_CXX11
8073
inline SEXP unwindProtect(std::function<SEXP(void)> callback) {
8174
return unwindProtect(&internal::unwindProtectUnwrap, &callback);
8275
}
83-
#endif
8476

8577
} // namespace Rcpp
8678

inst/tinytest/cpp/wrap.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// wrap.cpp: Rcpp R/C++ interface class library -- wrap unit tests
44
//
5-
// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2013 - 2025 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -168,10 +168,6 @@ SEXP nonnull_const_char(){
168168
return wrap(p) ;
169169
}
170170

171-
#ifdef RCPP_USING_CXX11
172-
// [[Rcpp::plugins(cpp11)]]
173-
#endif
174-
175171
// [[Rcpp::export]]
176172
IntegerVector unordered_map_string_int(){
177173
RCPP_UNORDERED_MAP< std::string, int > m ;

src/api.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ SEXP rcpp_can_use_cxx0x() { // #nocov start
229229

230230
// [[Rcpp::internal]]
231231
SEXP rcpp_can_use_cxx11() {
232-
#if defined(RCPP_USING_CXX11)
233-
return Rf_ScalarLogical(TRUE);
234-
#else
235-
return Rf_ScalarLogical(FALSE);
236-
#endif
232+
return Rf_ScalarLogical(TRUE);
237233
}
238234

239235
// [[Rcpp::register]]

0 commit comments

Comments
 (0)