The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
C Extension Pain: rb_pid_t

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
C Extension Pain: rb_pid_t Posted: Oct 27, 2005 12:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: C Extension Pain: rb_pid_t
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
Ugh, ugh, UGH!

In the "yet another change that isn't backwards compatible" department, 1.8.3 has added the rb_pid_t type. Apparently this was done after some issues with Subversion. I looked a bit at one of the threads that discussed this, but it's over my head. For whatever reason, Ruby had to define its own pid_t type, which all extension writers should now use instead.

Funny, no one bothered to mention this fact to me on the way to the forum.

The trick, then, is to make your C extensions compatible with both 1.8.3 and older versions of Ruby. To save you the torture of digging through mkmf.rb to find a solution to this problem, I've done it for you:
# extconf.rb
have_type("rb_pid_t", "ruby.h")

# your C file
#ifdef HAVE_TYPE_RB_PID_T
#define pid_t rb_pid_t
#endif

I dunno about you, but I'm having a ball with 1.8.3....

Read: C Extension Pain: rb_pid_t

Topic: Design Buzz Previous Topic   Next Topic Topic: Web Developer Documentation

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use