Module
Constants
No documentation available
Class Methods
ext/fiddle/lib/fiddle/ffi_backend.rb
View on GitHub
# File tmp/rubies/ruby-3.4.1/ext/fiddle/lib/fiddle/ffi_backend.rb, line 107
def self.to_ffi_type(fiddle_type)
if fiddle_type.is_a?(Symbol)
fiddle_type = Types.const_get(fiddle_type.to_s.upcase)
end
if !fiddle_type.is_a?(Integer) && fiddle_type.respond_to?(:to_int)
fiddle_type = fiddle_type.to_int
end
ffi_type = FFITypes[fiddle_type]
ffi_type = FFITypes[-fiddle_type] if ffi_type.nil? && fiddle_type.is_a?(Integer) && fiddle_type < 0
raise TypeError.new("cannot convert #{fiddle_type} to ffi") unless ffi_type
ffi_type
end
No documentation available