class SOME_STRUCT < FFI::Struct layout :a, :float, :b, :float end
and then
attach_function 'fn_name', [], SOME_STRUCT
and if it contains a stack:
typedef struct { float a, b; } SOME_STRUCT;
you should use this:
attach_function 'fn_name', [], SOME_STRUCT.by_value
source share