/* * Document-method: Fixnum#to_msgpack * * call-seq: * fixnum.to_msgpack(out = '') -> String * * Serializes the Fixnum into raw bytes. */ static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self) { ARG_BUFFER(out, argc, argv); #ifdef JRUBY msgpack_pack_long(out, FIXNUM_P(self) ? FIX2LONG(self) : rb_num2ll(self)); #else msgpack_pack_long(out, FIX2LONG(self)); #endif return out; }