Method: Fiddle::Packer#pack

Defined in:
lib/fiddle/pack.rb

#pack(ary) ⇒ Object



99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/fiddle/pack.rb', line 99

def pack(ary)
  case SIZEOF_VOIDP
  when SIZEOF_LONG
    ary.pack(@template)
  else
    if defined?(TYPE_LONG_LONG) and
      SIZEOF_VOIDP == SIZEOF_LONG_LONG
      ary.pack(@template)
    else
      raise(RuntimeError, "sizeof(void*)?")
    end
  end
end