class FFI::Struct

def hash_layout(builder, spec)

def hash_layout(builder, spec)
  raise "Ruby version not supported" if RUBY_VERSION =~ /1.8.*/
  mod = enclosing_module
  spec[0].each do |name,type|
    if type.kind_of?(Class) && type < Struct
      builder.add_struct(name, type)
    elsif type.kind_of?(::Array)
      builder.add_array(name, find_type(type[0], mod), type[1])
    else
      builder.add_field(name, find_type(type, mod))
    end
  end
end