Skip to content

Commit

Permalink
Restrict workaround to R-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 1, 2024
1 parent 4875778 commit 55c2288
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inst/include/cpp11/r_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,13 @@ inline void r_vector<T>::clear() {

inline SEXP truncate(SEXP x, R_xlen_t length, R_xlen_t capacity) {
// Avoid SETLENGTH() and SET_TRUELENGTH() which trigger a warning on R-devel 4.5
#if R_VERSION >= R_Version(3, 4, 0) && R_VERSION < R_Version(4, 5, 0)
SETLENGTH(x, length);
SET_TRUELENGTH(x, capacity);
SET_GROWABLE_BIT(x);
#else
x = safe[Rf_lengthgets](x, length);
#endif
return x;
}

Expand Down

0 comments on commit 55c2288

Please sign in to comment.