From: Michael Schroeder Date: Tue, 29 May 2012 13:54:45 +0000 (+0200) Subject: - make bindings work with ruby 1.9 X-Git-Tag: BASE-SuSE-Code-12_2-Branch~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da1607558a88464373b9fdd2b6a3764fc43b4f77;p=platform%2Fupstream%2Flibsolv.git - make bindings work with ruby 1.9 --- diff --git a/bindings/solv.i b/bindings/solv.i index e64a632..8a54307 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -143,9 +143,9 @@ int size, i; VALUE *o; queue_init(&$1); - size = RARRAY($input)->len; + size = RARRAY_LEN($input); i = 0; - o = RARRAY($input)->ptr; + o = RARRAY_PTR($input); for (i = 0; i < size; i++, o++) { int v; int e = SWIG_AsVal_int(*o, &v); @@ -370,6 +370,14 @@ typedef VALUE AppObjectPtr; #endif #include "solv_xfopen.h" +/* for old ruby versions */ +#ifndef RARRAY_PTR +#define RARRAY_PTR(ary) (RARRAY(ary)->ptr) +#endif +#ifndef RARRAY_LEN +#define RARRAY_LEN(ary) (RARRAY(ary)->len) +#endif + #define true 1 #define false 1