From 8b920fdd463ff880eda275e713e87c8faf8902ee Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sat, 15 Jun 2024 00:24:08 -0700 Subject: [PATCH] Use API setter/unsetter for S4 objects --- src/utils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.h b/src/utils.h index 4b67cce45..b3984b15b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -264,12 +264,12 @@ SEXP r_clone_referenced(SEXP x); SEXP r_call_n(SEXP fn, SEXP* tags, SEXP* cars); static inline SEXP r_mark_s4(SEXP x) { - SET_S4_OBJECT(x); - return(x); + x = Rf_asS4(x, (Rboolean) 1, 1); + return x; } static inline SEXP r_unmark_s4(SEXP x) { - UNSET_S4_OBJECT(x); - return(x); + x = Rf_asS4(x, (Rboolean) 0, 1); + return x; } bool r_has_name_at(SEXP names, R_len_t i);