--- libcaca-0.99.beta17/configure.ac~ 2010-02-08 13:34:28.000000000 +0100 +++ libcaca-0.99.beta17/configure.ac 2010-03-02 17:34:37.239187424 +0100 @@ -462,10 +462,10 @@ if test "${enable_ruby}" != "no"; then AC_PATH_PROG(RUBY, ruby, no) if test "${RUBY}" != "no"; then - RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')" - RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')" - RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'` - RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'` + RUBY_CFLAGS=`($RUBY -rmkmf -e 'puts "-I#$hdrdir/#{CONFIG["arch"]} -I#$hdrdir"') 2>/dev/null` + RUBY_LIBS="-L$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"RUBY_SO_NAME"@:>@')" + RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitearchdir"@:>@'` + RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitelibdir"@:>@'` AC_SUBST(RUBY_CFLAGS) AC_SUBST(RUBY_LIBS) AC_SUBST(RUBY_SITEARCHDIR) --- libcaca-0.99.beta17/ruby/caca-canvas.c~ 2009-12-14 18:38:56.000000000 +0100 +++ libcaca-0.99.beta17/ruby/caca-canvas.c 2010-03-02 17:40:06.868186374 +0100 @@ -274,7 +274,7 @@ int error = 0; VALUE v, x, y; - n = RARRAY(points)->len; + n = RARRAY_LEN(points); ax = (int*)malloc(n*sizeof(int)); if(!ax) @@ -290,7 +290,7 @@ for(i=0; i<n; i++) { v = rb_ary_entry(points, i); - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2)) + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2)) { x = rb_ary_entry(v,0); y = rb_ary_entry(v,1); @@ -336,7 +336,7 @@ int error = 0; VALUE v, x, y; - n = RARRAY(points)->len; + n = RARRAY_LEN(points); ax = (int*)malloc(n*sizeof(int)); if(!ax) @@ -352,7 +352,7 @@ for(i=0; i<n; i++) { v = rb_ary_entry(points, i); - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2)) + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2)) { x = rb_ary_entry(v,0); y = rb_ary_entry(v,1); @@ -459,7 +459,7 @@ float cuv[6]; VALUE v; - l = RARRAY(coords)->len; + l = RARRAY_LEN(coords); if(l != 6 && l != 3) { rb_raise(rb_eArgError, "invalid coords list"); @@ -471,14 +471,14 @@ ccoords[i] = NUM2INT(v); else { - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2)) + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2)) rb_raise(rb_eArgError, "invalid coords list"); ccoords[2*i] = NUM2INT(rb_ary_entry(v, 0)); ccoords[2*i+1] = NUM2INT(rb_ary_entry(v, 1)); } } - l = RARRAY(uv)->len; + l = RARRAY_LEN(uv); if(l != 6 && l != 3) { rb_raise(rb_eArgError, "invalid uv list"); @@ -490,7 +490,7 @@ cuv[i] = NUM2DBL(v); else { - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2)) + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2)) rb_raise(rb_eArgError, "invalid uv list"); ccoords[2*i] = NUM2DBL(rb_ary_entry(v, 0)); ccoords[2*i+1] = NUM2DBL(rb_ary_entry(v, 1)); @@ -600,7 +600,7 @@ static VALUE import_from_memory(VALUE self, VALUE data, VALUE format) { long int bytes; - bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format)); + bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format)); if(bytes <= 0) rb_raise(rb_eRuntimeError, strerror(errno)); @@ -610,7 +610,7 @@ static VALUE import_area_from_memory(VALUE self, VALUE x, VALUE y, VALUE data, VALUE format) { long int bytes; - bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format)); + bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format)); if(bytes <= 0) rb_raise(rb_eRuntimeError, strerror(errno)); --- libcaca-0.99.beta17/ruby/caca-dither.c~ 2009-11-17 16:58:37.000000000 +0100 +++ libcaca-0.99.beta17/ruby/caca-dither.c 2010-03-02 17:40:33.434124529 +0100 @@ -48,7 +48,7 @@ VALUE v, r, g, b, a; int error = 0; - if(RARRAY(palette)->len != 256) + if(RARRAY_LEN(palette) != 256) { rb_raise(rb_eArgError, "Palette must contain 256 elements"); } @@ -84,7 +84,7 @@ for(i=0; i<256; i++) { v = rb_ary_entry(palette, i); - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 4)) + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 4)) { r = rb_ary_entry(v,0); g = rb_ary_entry(v,1);