module FFI::Library
def function_names(name, arg_types)
- 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| size = arg.size # The size must be a multiple of 4 size += (4 - size) % 4 mem + size end result << "_#{name.to_s}@#{size}" # win32 result << "#{name.to_s}@#{size}" # win64 end result end