From 7f1938c695286dc3cf1d27a4e88483a52ff3a92b Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Wed, 26 Jun 2024 11:07:53 +0900 Subject: [PATCH] Do not define VECTOR_PTR_RO on R >= 4.5 --- src/vctrs-core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vctrs-core.h b/src/vctrs-core.h index f02c10b9a..89f5a40c8 100644 --- a/src/vctrs-core.h +++ b/src/vctrs-core.h @@ -106,7 +106,9 @@ enum vctrs_dbl dbl_classify(double x); # define DATAPTR_RO(x) ((const void*) STRING_PTR(x)) #endif -#define VECTOR_PTR_RO(x) ((const SEXP*) DATAPTR_RO(x)) +#if (R_VERSION < R_Version(4, 5, 0)) +# define VECTOR_PTR_RO(x) ((const SEXP*) DATAPTR_RO(x)) +#endif // Likely supplied in R 4.4.0 // https://github.com/wch/r-source/commit/38403c9c347dd5426da6009573b087188ec6be04