Skip to content

Commit

Permalink
Reapply "Restrict workaround to R-devel"
Browse files Browse the repository at this point in the history
This reverts commit 1578c4968aeeaaa583e06ec2100ffdb72de93211.
  • Loading branch information
krlmlr committed Jul 4, 2024
1 parent 0f75f95 commit eda4730
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 @@ -899,7 +899,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 eda4730

Please sign in to comment.