module Fiddle::JRuby

Constants

FFITypes

Public Class Methods

__ffi_type__ (dl_type)
# File ext/fiddle/lib/fiddle/jruby.rb, line 107
def self.__ffi_type__(dl_type)
  if dl_type.is_a?(Symbol)
    dl_type = Types.const_get(dl_type.to_s.upcase)
  end
  if !dl_type.is_a?(Integer) && dl_type.respond_to?(:to_int)
    dl_type = dl_type.to_int
  end
  ffi_type = FFITypes[dl_type]
  ffi_type = FFITypes[-dl_type] if ffi_type.nil? && dl_type.is_a?(Integer) && dl_type < 0
  raise TypeError.new("cannot convert #{dl_type} to ffi") unless ffi_type
  ffi_type
end