MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / addExtern

Function addExtern

include/daScript/ast/ast_interop.h:295–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293 template <typename FuncT, FuncT fn, template <typename FuncTT, FuncTT fnt> class SimNodeT = SimNode_ExtFuncCall, typename QQ = defaultTempFn>
294#endif
295 inline auto addExtern ( Module & mod, const ModuleLibrary & lib, const char * name, SideEffects seFlags,
296 const char * cppName = nullptr, QQ && tempFn = QQ() ) {
297#if DAS_SLOW_CALL_INTEROP
298 using SimNodeType = SimNodeT<FuncT>;
299 auto fnX = new ExternalFn<FuncT, SimNodeType, FuncT>(fn, name, lib, cppName);
300#else
301 using SimNodeType = SimNodeT<FuncT, fn>;
302 auto fnX = new ExternalFn<FuncT, fn, SimNodeType, FuncT>(name, lib, cppName);
303#endif
304
305 tempFn(fnX);
306#if VERIFY_JIT_ARGUMENTS
307 VerifyFn<FuncT, fn>::verify(fnX);
308#endif
309 addExternFunc(mod, fnX, SimNodeType::IS_CMRES, seFlags);
310 return fnX;
311 }
312
313#if DAS_SLOW_CALL_INTEROP
314 template <typename FuncT, FuncT fn, template <typename FuncTT> class SimNodeT = SimNode_ExtFuncCall, typename QQ = defaultTempFn>

Callers

nothing calls this directly

Calls 2

verifyFunction · 0.85
addExternFuncFunction · 0.85

Tested by

no test coverage detected