On Sep 24, 9:42 pm, "Tim Felgentreff" <[email protected]>
wrote:
> The availability of rb_thread_blocking_region is announced by a #define 
> HAVE_RB_THREAD_BLOCKING_REGION. At least on JRuby, supporting the TRAP_X 
> macros would be a lot of work an it would be nice if pcap could run there, 
> too, sometime, without forcing ruby version 1.9

MRI 1.9.1 does not seem to define that flag, so that's not a one-stop
solution either. My local version of the pcap gem now works on rbx, as
well as 1.8.7 and 1.9.1 with a rather simple preprocessor trick and
some more version magic in extconf.rbto work around an issue with
rb_thread_fd_close() which does not exist in rbx, but in 1.9.x and
1.8.7. For now I'm just omitting that call where it doesn't exist, as
that's compliant with the current "/* TODO: fix me */" implementation
in MRI.

Another nicety is that pcap uses SIZEOF_VOIDP which is not provided in
rbx, but that looks like a rather icky design decision in pcap to
ensure IPv4 addresses can be encoded in VALUE.

If you are interested, you can look at the progress so far at
http://github.com/ngollan/pcap-ruby-apis

I am a total beginner at Ruby C API stuff, so I'm pretty much going
from error to error until it compiles, and then doesn't break
horribly. If anything I did is total bogus, please correct me ;-)

-- 
--- !ruby/object:MailingList
name: rubinius-dev
view: http://groups.google.com/group/rubinius-dev?hl=en
post: [email protected]
unsubscribe: [email protected]

Reply via email to