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