Subject:
[ruby-ffi] Attaching function with two different signatures
From:
Arvicco
Date:
6/4/10 12:18 AM
To:
ruby-ffi

Sorry to post amateurish question, but I have really hard time
figuring out how to attach a function that has 2 different signatures.
For example, last argument in SendMessage from Win32 API can be
either :long or :pointer:

attach_function :SendMessage, [:ulong, :uint, :uint, :long], :int
 attach_function :SendMessage,
[:ulong, :uint, :uint, :pointer], :int

 I need to be able to call this function with any type, but it seems
that it is only possible to  attach a function with one signature. I
honestly tried to find the way on FFI wiki and rdoc pages, but wasn't
able to figure out how to go about it. :( Any hints or pointers will
be much appreciated...

Regards, Arvicco