Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2026-04-02 Dirk Eddelbuettel <edd@debian.org>

* inst/include/Rcpp/Function.h: Further refinement for 4.6.0 to not
require R_NamespaceRegistry, using R_getRegisteredNamespace() instead

2026-04-01 Mattias Ellert <mattias.ellert@physics.uu.se>

* inst/discovery/cxx0x.R: Set execute permissions for script
Expand Down
10 changes: 9 additions & 1 deletion inst/include/Rcpp/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ namespace Rcpp{

Function_Impl(const std::string& name, const std::string& ns) {
#if R_VERSION < R_Version(4,5,0)
// before R 4.5.0 we would use Rf_findVarInFrame
Shield<SEXP> env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str())));
if (env == R_UnboundValue)
stop("there is no namespace called \"%s\"", ns);
#else
#elif R_VERSION < R_Version(4,6,0) || R_SVN_REVISION < 89746
// during R 4.5.* and before final R 4.6.0 we could use R_getVarEx
// along with R_NamespaceRegistry but avoid R_UnboundValue
Shield<SEXP> env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_NilValue));
if (env == R_NilValue)
stop("there is no namespace called \"%s\"", ns);
#else
// late R 4.6.0 development got us R_getRegisteredNamespace
Shield<SEXP> env(R_getRegisteredNamespace(ns.c_str()));
if (env == R_NilValue)
stop("there is no namespace called \"%s\"", ns);
#endif
get_function(name, env);
}
Expand Down
Loading