diff --git a/src/qs_serialize_common.h b/src/qs_serialize_common.h index a0fc06a..873b9e5 100644 --- a/src/qs_serialize_common.h +++ b/src/qs_serialize_common.h @@ -7,6 +7,10 @@ #include +#if (R_VERSION < R_Version(3, 5, 0)) +#define STRING_PTR_RO STRING_PTR +#endif + static std::unordered_set< std::pair, boost::hash> @@ -432,7 +436,7 @@ void writeObject(T * const sobj, SEXP x) { if(attrs.size() > 0) writeAttributeHeader_common(attrs.size(), sobj); uint64_t dl = Rf_xlength(x); writeHeader_common(qstype::CHARACTER, dl, sobj); - SEXP * xptr = STRING_PTR(x); + const SEXP * xptr = STRING_PTR_RO(x); for(uint64_t i=0; i