From 6b771d2c628c7fd527d6667dd26150ac155cbc8d Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Thu, 26 Mar 2009 04:55:34 +0000 Subject: [PATCH] THRIFT-408. rb: Ruby C extension doesn't build on 1.8.5 This patch redefines the important macros so 1.8.5 is compatible. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758517 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/ext/macros.h | 12 ++++++++++++ lib/rb/ext/memory_buffer.c | 1 + lib/rb/ext/struct.c | 1 + 3 files changed, 14 insertions(+) diff --git a/lib/rb/ext/macros.h b/lib/rb/ext/macros.h index 6dbb7ad5..8e1f3434 100644 --- a/lib/rb/ext/macros.h +++ b/lib/rb/ext/macros.h @@ -26,4 +26,16 @@ #ifndef RFLOAT_VALUE # define RFLOAT_VALUE(v) RFLOAT(rb_Float(v))->value +#endif + +#ifndef RSTRING_LEN +# define RSTRING_LEN(v) RSTRING(rb_String(v))->len +#endif + +#ifndef RSTRING_PTR +# define RSTRING_PTR(v) RSTRING(rb_String(v))->ptr +#endif + +#ifndef RARRAY_LEN +# define RARRAY_LEN(v) RARRAY(rb_Array(v))->len #endif \ No newline at end of file diff --git a/lib/rb/ext/memory_buffer.c b/lib/rb/ext/memory_buffer.c index e90de750..12dab312 100644 --- a/lib/rb/ext/memory_buffer.c +++ b/lib/rb/ext/memory_buffer.c @@ -19,6 +19,7 @@ #include #include +#include "macros.h" ID buf_ivar_id; ID index_ivar_id; diff --git a/lib/rb/ext/struct.c b/lib/rb/ext/struct.c index 4947e264..8dd5c3ea 100644 --- a/lib/rb/ext/struct.c +++ b/lib/rb/ext/struct.c @@ -19,6 +19,7 @@ #include #include +#include "macros.h" #ifndef HAVE_STRLCPY -- 2.17.1