mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-20 14:02:40 +02:00
ruby: fixes compatibility with ruby-1.8.5
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "ruby.h"
|
||||
#include "encoding.h"
|
||||
#include "compat.h"
|
||||
|
||||
#include "msgpack/pack_define.h"
|
||||
|
||||
@@ -169,7 +169,7 @@ static VALUE MessagePack_Float_to_msgpack(int argc, VALUE *argv, VALUE self)
|
||||
static VALUE MessagePack_String_to_msgpack(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
ARG_BUFFER(out, argc, argv);
|
||||
#ifdef MSGPACK_RUBY_ENCODING
|
||||
#ifdef COMPAT_HAVE_ENCODING
|
||||
int enc = ENCODING_GET(self);
|
||||
if(enc != s_enc_utf8 && enc != s_enc_ascii8bit && enc != s_enc_usascii) {
|
||||
if(!ENC_CODERANGE_ASCIIONLY(self)) {
|
||||
@@ -193,7 +193,7 @@ static VALUE MessagePack_String_to_msgpack(int argc, VALUE *argv, VALUE self)
|
||||
*/
|
||||
static VALUE MessagePack_Symbol_to_msgpack(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
#ifdef MSGPACK_RUBY_ENCODING
|
||||
#ifdef COMPAT_HAVE_ENCODING
|
||||
return MessagePack_String_to_msgpack(argc, argv, rb_id2str(SYM2ID(self)));
|
||||
#else
|
||||
ARG_BUFFER(out, argc, argv);
|
||||
|
Reference in New Issue
Block a user