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

Function addExternFunc

src/ast/ast_interop.cpp:6–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4 // add extern func
5
6 void addExternFunc(Module& mod, const FunctionPtr & fnX, bool isCmres, SideEffects seFlags) {
7 if (!isCmres) {
8 if (fnX->result->isRefType() && !fnX->result->ref) {
9 DAS_FATAL_ERROR(
10 "addExtern(%s)::failed in module %s\n"
11 " this function should be bound with addExtern<DAS_BIND_FUNC(%s), SimNode_ExtFuncCallAndCopyOrMove>\n"
12 " likely cast<> is implemented for the return type, and it should not\n",
13 fnX->name.c_str(), mod.name.c_str(), fnX->name.c_str());
14 }
15 }
16 fnX->setSideEffects(seFlags);
17 if (!mod.addFunction(fnX)) {
18 DAS_FATAL_ERROR("addExtern(%s) failed in module %s\n", fnX->name.c_str(), mod.name.c_str());
19 }
20 }
21}

Callers 4

addExternFunction · 0.85
addExternExFunction · 0.85
addExternTempRefFunction · 0.85
addInteropFunction · 0.85

Calls 4

setSideEffectsMethod · 0.80
isRefTypeMethod · 0.45
c_strMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected