diff --git a/lib/unifex/code_generator/base_types/int64.ex b/lib/unifex/code_generator/base_types/int64.ex index aecad51..a65c7de 100644 --- a/lib/unifex/code_generator/base_types/int64.ex +++ b/lib/unifex/code_generator/base_types/int64.ex @@ -12,4 +12,19 @@ defmodule Unifex.CodeGenerator.BaseTypes.Int64 do def generate_native_type(_ctx) do ~g end + + defmodule NIF do + @moduledoc false + use Unifex.CodeGenerator.BaseType + + @impl true + def generate_arg_parse(argument, variable, _ctx) do + ~g<({ + ErlNifSInt64 temp = 0; + int success = enif_get_int64(env, #{argument}, &temp); + #{variable} = (int64_t)temp; + success; + })> + end + end end