module FFI::Library

def function_names(name, arg_types)

Other tags:
    Note: - Function names on windows may be decorated if they are using stdcall. See

Returns:
  • (Array) -

Parameters:
  • arg_types (Array) -- function's argument types
  • name (#to_s) -- function name
def function_names(name, arg_types)
  result = [name.to_s]
  if ffi_convention == :stdcall
    # Get the size of each parameter
    size = arg_types.inject(0) do |mem, arg|
      mem + arg.size
    end
    # Next, the size must be a multiple of 4
    size += (4 - size) % 4
    result << "_#{name.to_s}@#{size}" # win32
    result << "#{name.to_s}@#{size}" # win64
  end
  result
end