Skip to content

Commit

Permalink
STRING_PTR_RO
Browse files Browse the repository at this point in the history
  • Loading branch information
traversc committed Sep 28, 2024
1 parent bdddf52 commit 3f244d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qs_serialize_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#include <qs_common.h>

#if (R_VERSION < R_Version(3, 5, 0))
#define STRING_PTR_RO STRING_PTR
#endif

static std::unordered_set<
std::pair<std::string, std::string>,
boost::hash<std::pair<std::string, std::string>>
Expand Down Expand Up @@ -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<dl; i++) {
SEXP xi = xptr[i]; // STRING_ELT(x, i);
if(xi == NA_STRING) {
Expand Down

0 comments on commit 3f244d5

Please sign in to comment.