From: Eric Wong Date: 2013-04-07T04:01:33+09:00 Subject: Re: C API version / functionality detection William Fulton wrote: > Macros containing text such as RUBY_VERSION can't be usefully used by > the C preprocessor, but the numeric ones such as RUBY_API_VERSION_CODE > or the old RUBY_VERSION_CODE can be. However, they are in version.h > which poses two problems. First this file isn't always shipped (eg in > some Debian based system, such as ruby-1.9.0 on Ubuntu 10.04). Secondly > in order to get the macro one needs a '#include "version.h"' which is a > rather commonly named file name, so it may pick up some other version.h > file which is no good at all as our users are expected to use their own > code. Instead of version.h, I suggest ruby/version.h #include > Anyway, I've fixed the problem above as rb_respond_to changed in a > subtle way in 1.9 and the '== Qtrue' should be dropped to check for > success. Using RTEST() should work reliably.