Extern C support for registering function overloads
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3a9f1f976a
commit
45d3bc690b
|
@ -110,6 +110,17 @@ namespace Porygon{
|
|||
return type;
|
||||
}
|
||||
|
||||
ScriptType* RegisterUserDataFunctionScriptTypeOption(GenericFunctionScriptType* existing, ScriptType* returnType,
|
||||
ScriptType* parameters[], size_t parameterCount){
|
||||
vector<shared_ptr<const ScriptType>> vector(parameterCount);
|
||||
for (size_t i = 0; i < parameterCount; i++){
|
||||
vector[i] = shared_ptr<const ScriptType>(parameters[i]);
|
||||
}
|
||||
auto option = new UserData::UserDataFunctionOption(shared_ptr<const ScriptType>(returnType), vector);
|
||||
existing->RegisterFunctionOption(option);
|
||||
return existing;
|
||||
}
|
||||
|
||||
TypeClass GetTypeClass(ScriptType* t){
|
||||
return t->GetClass();
|
||||
}
|
||||
|
|
|
@ -13,5 +13,11 @@ namespace Porygon::UserData{
|
|||
t->RegisterOption(opt);
|
||||
return t;
|
||||
}
|
||||
|
||||
void RegisterFunctionEvalValueOption(const GenericFunctionEvalValue* val,
|
||||
const Evaluation::EvalValue* (*func)(void*, const ScriptOptions*, const EvalValue* [], int ), void* obj){
|
||||
auto opt = new UserDataFunction(func, obj);
|
||||
val->RegisterOption(opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue