mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
fixes for standalone C++ scripts making types & variables/functions available
This commit is contained in:
parent
fb9c73fa86
commit
725aa558a7
13 changed files with 125 additions and 19 deletions
|
@ -22,7 +22,8 @@ function load_CPP%(h: count%): bool
|
|||
%{
|
||||
auto cb = detail::standalone_callbacks.find(h);
|
||||
|
||||
if ( cb == detail::standalone_callbacks.end() )
|
||||
if ( cb == detail::standalone_callbacks.end() ||
|
||||
! detail::CPP_init_hook )
|
||||
{
|
||||
reporter->Error("load of non-existing C++ code (%" PRIu64 ")", h);
|
||||
return zeek::val_mgr->False();
|
||||
|
@ -38,5 +39,8 @@ function load_CPP%(h: count%): bool
|
|||
// compiled scripts.
|
||||
detail::standalone_activations.push_back(cb->second);
|
||||
|
||||
// Proceed with activation.
|
||||
(*detail::CPP_init_hook)();
|
||||
|
||||
return zeek::val_mgr->True();
|
||||
%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue