Hi,

I'm trying to make the pcap gem work on Rubinius. That gem uses the
trapping mechanism (TRAP_BEG/TRAP_END) from the 1.8.7 API, which
Rubinius does not provide; instead, there's the
rb_thread_blocking_region call from the 1.9 API. Now things get
complicated, since Rubinius announces RUBY_VERSION 1.8.7, so I cannot
use the version string for disambiguation.

For now, it seems to be possible to use the (rbx-specific) RUBY_ENGINE
constant, but that's not defined in MRI 1.8.x. What I'm doing in
extconf.rb right now is:

begin
  if RUBY_VERSION =~ /^1\.9\./ or RUBY_ENGINE == "rbx"
    cflags << '-DHAVE_1_9_THREAD_API'
  end
rescue NameError
  # ignore errors trying to accept RUBY_ENGINE
end

It would be nice if rbx provided the TRAP_* macros like MRI does, at
least as long as it announces version 1.8.

-- 
--- !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