Method: FFI::Library#ffi_convention

Defined in:
lib/ffi/library.rb

#ffi_convention(convention = nil) ⇒ Symbol

Note:

:stdcall is typically used for attaching Windows API functions

Set the calling convention for #attach_function and #callback

Parameters:

  • convention (Symbol) (defaults to: nil)

    one of :default, :stdcall

Returns:

  • (Symbol)

    the new calling convention

See Also:



106
107
108
109
110
# File 'lib/ffi/library.rb', line 106

def ffi_convention(convention = nil)
  @ffi_convention ||= :default
  @ffi_convention = convention if convention
  @ffi_convention
end