support for standalone compiled scripts to export globals with module qualifiers

This commit is contained in:
Vern Paxson 2021-06-11 08:49:52 -07:00
parent 4ecf70f515
commit b4f025dda9
5 changed files with 59 additions and 19 deletions

View file

@ -109,9 +109,11 @@ void CPPCompile::CreateGlobal(const ID* g)
const auto& t = g->GetType();
NoteInitDependency(g, TypeRep(t));
auto exported = g->IsExport() ? "true" : "false";
AddInit(g, globals[gn],
string("lookup_global__CPP(\"") + gn + "\", " +
GenTypeName(t) + ")");
GenTypeName(t) + ", " + exported + ")");
}
if ( is_bif )