ruby: improves compatibility with JRuby

This commit is contained in:
FURUHASHI Sadayuki
2011-05-09 21:59:55 +09:00
parent 96bb4cf49d
commit f50694cc96
2 changed files with 38 additions and 12 deletions

View File

@@ -113,7 +113,11 @@ static VALUE MessagePack_FalseClass_to_msgpack(int argc, VALUE *argv, VALUE self
static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
#ifdef JRUBY
msgpack_pack_long(out, rb_num2long(self));
#else
msgpack_pack_long(out, FIX2LONG(self));
#endif
return out;
}