Support for handling null when creating evalvalues

This commit is contained in:
Deukhoofd committed 2019-08-25 12:41:37 +02:00
1 parent 29b2df793d
commit cb1273b92e
2 files changed
+4

No files matched your search

@@ -10,6 +10,8 @@ namespace PorygonSharp.EvalValues
{
public static EvalValue CreateValue(object o)
{
if (o == null)
return new EvalValue(CreateNilEvalValue());
var type = o.GetType();
if (type.IsEnum && !type.IsGenericParameter)
{
@@ -64,6 +66,8 @@ namespace PorygonSharp.EvalValues
return new EvalValue(ptr);
}
[DllImport("libPorygonLang", EntryPoint = "CreateNilEvalValue",CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr CreateNilEvalValue();
[DllImport("libPorygonLang", EntryPoint = "CreateIntegerEvalValue",CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr CreateIntegerEvalValue(long l);
[DllImport("libPorygonLang", EntryPoint = "CreateFloatEvalValue",CallingConvention = CallingConvention.Cdecl)]
Binary file not shown.