Skip to content

Commit bb52f85

Browse files
committed
Further R-devel driven refinement for function-in-namespace lookup
1 parent 7f928e7 commit bb52f85

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2026-04-02 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/Function.h: Further refinement for 4.6.0 to not
4+
require R_NamespaceRegistry, using R_getRegisteredNamespace() instead
5+
16
2026-04-01 Mattias Ellert <mattias.ellert@physics.uu.se>
27

38
* inst/discovery/cxx0x.R: Set execute permissions for script

inst/include/Rcpp/Function.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ namespace Rcpp{
7070
}
7171

7272
Function_Impl(const std::string& name, const std::string& ns) {
73-
#if R_VERSION < R_Version(4,5,0)
73+
#if R_VERSION < R_Version(4,6,0)
7474
Shield<SEXP> env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str())));
7575
if (env == R_UnboundValue)
76+
Shield<SEXP> env(R_getRegisteredNamespace(ns.c_str()));
77+
if (env == R_NilValue)
7678
stop("there is no namespace called \"%s\"", ns);
7779
#else
7880
Shield<SEXP> env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_NilValue));

0 commit comments

Comments
 (0)