Skip to content

Commit 8b920fd

Browse files
Use API setter/unsetter for S4 objects
1 parent 920903d commit 8b920fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ SEXP r_clone_referenced(SEXP x);
264264
SEXP r_call_n(SEXP fn, SEXP* tags, SEXP* cars);
265265

266266
static inline SEXP r_mark_s4(SEXP x) {
267-
SET_S4_OBJECT(x);
268-
return(x);
267+
x = Rf_asS4(x, (Rboolean) 1, 1);
268+
return x;
269269
}
270270
static inline SEXP r_unmark_s4(SEXP x) {
271-
UNSET_S4_OBJECT(x);
272-
return(x);
271+
x = Rf_asS4(x, (Rboolean) 0, 1);
272+
return x;
273273
}
274274

275275
bool r_has_name_at(SEXP names, R_len_t i);

0 commit comments

Comments
 (0)