Sha256: 21eca6944ebe244d2de3061969d67782f31e478c11797b7564e37d5ff4ac8cec

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

/* Ruby 1.9.3 doesn't need a C extension while 1.9.2 does. I can't figure
   out a way build a gem so that it loads the C extension conditionally.
   So instead we have a simple stupid stub extension. 

   This as it is not elegant. 
*/
   
#include <ruby.h>
#include <ruby/version.h>
#include <string.h>
void
Init_thread_frame(void)
{
    if (0 == strncmp("1.9.2", ruby_version, sizeof("1.9.2")))
    {
	rb_raise(rb_eLoadError, 
		 "Gem installed under Ruby 1.9.3 but this Ruby 1.9.2. Please reinstall 'rb-threadframe' gem under 1.9.2.");
    } else if (0 == strncmp("1.9.3", ruby_version, sizeof("1.9.3"))) {
	rb_raise(rb_eLoadError, 
		 "Under Ruby 1.9.3 there is no reason to load this thread_frame C extension.");
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rb-threadframe-0.40 ext/1.9.3/thread_frame.c