From 14975fc36689d8eb7384728ec8b72e711e8f9eb3 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 19 Mar 2023 14:31:05 -0500 Subject: [PATCH] Do not add ', PACKAGE=...' when registration is used --- src/attributes.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/attributes.cpp b/src/attributes.cpp index 03c5ff507..4364db4c2 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -2541,9 +2541,11 @@ namespace attributes { ostr() << "methods::setLoadAction(function(ns) {" << std::endl; ostr() << " .Call(" << (registration_ ? "`" : "'") - << registerCCallableExportedName() - << (registration_ ? "`" : "'") - << ", PACKAGE = '" << package() << "')" + << registerCCallableExportedName() + << (registration_ ? "`" : "'"); + if (!registration_) + ostr() << ", PACKAGE = '" << package() << "'"; + ostr() << ")" << std::endl << "})" << std::endl; // #nocov end } }