fixes for standalone C++ scripts making types & variables/functions available

This commit is contained in:
Vern Paxson 2021-06-04 17:14:46 -07:00
parent fb9c73fa86
commit 725aa558a7
13 changed files with 125 additions and 19 deletions

View file

@ -168,7 +168,12 @@ void CPPCompile::AddBiF(const ID* b, bool is_var)
if ( AddGlobal(n, "bif", true) )
Emit("Func* %s;", globals[n]);
AddInit(b, globals[n], string("lookup_bif__CPP(\"") + bn + "\")");
auto lookup = string("lookup_bif__CPP(\"") + bn + "\")";
if ( standalone )
AddActivation(globals[n] + " = " + lookup + ";");
else
AddInit(b, globals[n], lookup);
}
bool CPPCompile::AddGlobal(const string& g, const char* suffix, bool track)