Author: bryanduxbury
Date: Thu Mar 26 04:55:34 2009
New Revision: 758517

URL: http://svn.apache.org/viewvc?rev=758517&view=rev
Log:
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.


Modified:
    incubator/thrift/trunk/lib/rb/ext/macros.h
    incubator/thrift/trunk/lib/rb/ext/memory_buffer.c
    incubator/thrift/trunk/lib/rb/ext/struct.c

Modified: incubator/thrift/trunk/lib/rb/ext/macros.h
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/ext/macros.h?rev=758517&r1=758516&r2=758517&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/ext/macros.h (original)
+++ incubator/thrift/trunk/lib/rb/ext/macros.h Thu Mar 26 04:55:34 2009
@@ -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

Modified: incubator/thrift/trunk/lib/rb/ext/memory_buffer.c
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/ext/memory_buffer.c?rev=758517&r1=758516&r2=758517&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/ext/memory_buffer.c (original)
+++ incubator/thrift/trunk/lib/rb/ext/memory_buffer.c Thu Mar 26 04:55:34 2009
@@ -19,6 +19,7 @@
 
 #include <ruby.h>
 #include <constants.h>
+#include "macros.h"
 
 ID buf_ivar_id;
 ID index_ivar_id;

Modified: incubator/thrift/trunk/lib/rb/ext/struct.c
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/ext/struct.c?rev=758517&r1=758516&r2=758517&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/ext/struct.c (original)
+++ incubator/thrift/trunk/lib/rb/ext/struct.c Thu Mar 26 04:55:34 2009
@@ -19,6 +19,7 @@
 
 #include <struct.h>
 #include <constants.h>
+#include "macros.h"
 
 #ifndef HAVE_STRLCPY
 


Reply via email to