Skip to content

Commit

Permalink
Merge pull request #1157 from stan-dev/c-api-extptr
Browse files Browse the repository at this point in the history
Replace non-API EXTPTR_PTR with R_ExternalPtrAddr
  • Loading branch information
andrjohns authored Mar 11, 2025
2 parents 7d9f8df + fff3640 commit 88566bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rstan/rstan/src/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ SEXP is_Null_NS(SEXP ns) {
LOGICAL(ans)[0] = 1;
PROTECT(ns);
if (TYPEOF(ns) == EXTPTRSXP) {
// Rprintf("ptr=%p.\n", EXTPTR_PTR(ns));
if (EXTPTR_PTR(ns) != NULL) LOGICAL(ans)[0] = 0;
if (R_ExternalPtrAddr(ns) != NULL) LOGICAL(ans)[0] = 0;
}
UNPROTECT(2);
return ans;
}

0 comments on commit 88566bb

Please sign in to comment.