Avoid Win32 functions
[git/cygwin-packages/libcaca.git] / 0.99.18-ruby19.patch
1 --- origsrc/libcaca-0.99.beta18/configure.ac 2012-04-06 15:39:42.000000000 -0500
2 +++ src/libcaca-0.99.beta18/configure.ac 2012-08-24 19:19:15.824013900 -0500
3 @@ -462,10 +462,11 @@ ac_cv_my_have_ruby="no"
4 if test "${enable_ruby}" != "no"; then
5 AC_PATH_PROG(RUBY, ruby, no)
6 if test "${RUBY}" != "no"; then
7 - RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')"
8 - RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
9 - RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
10 - RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
11 + RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"rubyhdrdir"@:>@ || RbConfig::CONFIG@<:@"rubydir"@:>@')"
12 + RUBY_CFLAGS="${RUBY_CFLAGS} ${RUBY_CFLAGS}/$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"arch"@:>@')"
13 + RUBY_LIBS="-L$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
14 + RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"vendorarchdir"@:>@'`
15 + RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"vendorlibdir"@:>@'`
16 AC_SUBST(RUBY_CFLAGS)
17 AC_SUBST(RUBY_LIBS)
18 AC_SUBST(RUBY_SITEARCHDIR)
19 --- origsrc/libcaca-0.99.beta18/ruby/caca-canvas.c 2010-02-15 17:49:40.000000000 -0600
20 +++ src/libcaca-0.99.beta18/ruby/caca-canvas.c 2012-08-24 19:05:44.195591400 -0500
21 @@ -274,7 +274,7 @@ static VALUE draw_polyline(VALUE self, V
22 int error = 0;
23 VALUE v, x, y;
24
25 - n = RARRAY(points)->len;
26 + n = RARRAY_LEN(points);
27
28 ax = (int*)malloc(n*sizeof(int));
29 if(!ax)
30 @@ -290,7 +290,7 @@ static VALUE draw_polyline(VALUE self, V
31 for(i=0; i<n; i++)
32 {
33 v = rb_ary_entry(points, i);
34 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2))
35 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2))
36 {
37 x = rb_ary_entry(v,0);
38 y = rb_ary_entry(v,1);
39 @@ -336,7 +336,7 @@ static VALUE draw_thin_polyline(VALUE se
40 int error = 0;
41 VALUE v, x, y;
42
43 - n = RARRAY(points)->len;
44 + n = RARRAY_LEN(points);
45
46 ax = (int*)malloc(n*sizeof(int));
47 if(!ax)
48 @@ -352,7 +352,7 @@ static VALUE draw_thin_polyline(VALUE se
49 for(i=0; i<n; i++)
50 {
51 v = rb_ary_entry(points, i);
52 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2))
53 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2))
54 {
55 x = rb_ary_entry(v,0);
56 y = rb_ary_entry(v,1);
57 @@ -459,7 +459,7 @@ static VALUE fill_triangle_textured(VALU
58 float cuv[6];
59 VALUE v;
60
61 - l = RARRAY(coords)->len;
62 + l = RARRAY_LEN(coords);
63 if(l != 6 && l != 3)
64 {
65 rb_raise(rb_eArgError, "invalid coords list");
66 @@ -471,14 +471,14 @@ static VALUE fill_triangle_textured(VALU
67 ccoords[i] = NUM2INT(v);
68 else
69 {
70 - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2))
71 + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2))
72 rb_raise(rb_eArgError, "invalid coords list");
73 ccoords[2*i] = NUM2INT(rb_ary_entry(v, 0));
74 ccoords[2*i+1] = NUM2INT(rb_ary_entry(v, 1));
75 }
76 }
77
78 - l = RARRAY(uv)->len;
79 + l = RARRAY_LEN(uv);
80 if(l != 6 && l != 3)
81 {
82 rb_raise(rb_eArgError, "invalid uv list");
83 @@ -490,7 +490,7 @@ static VALUE fill_triangle_textured(VALU
84 cuv[i] = NUM2DBL(v);
85 else
86 {
87 - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2))
88 + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2))
89 rb_raise(rb_eArgError, "invalid uv list");
90 ccoords[2*i] = NUM2DBL(rb_ary_entry(v, 0));
91 ccoords[2*i+1] = NUM2DBL(rb_ary_entry(v, 1));
92 @@ -600,7 +600,7 @@ static VALUE render_canvas(VALUE self, V
93 static VALUE import_from_memory(VALUE self, VALUE data, VALUE format)
94 {
95 long int bytes;
96 - bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format));
97 + bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format));
98 if(bytes <= 0)
99 rb_raise(rb_eRuntimeError, strerror(errno));
100
101 @@ -610,7 +610,7 @@ static VALUE import_from_memory(VALUE se
102 static VALUE import_area_from_memory(VALUE self, VALUE x, VALUE y, VALUE data, VALUE format)
103 {
104 long int bytes;
105 - bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format));
106 + bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format));
107 if(bytes <= 0)
108 rb_raise(rb_eRuntimeError, strerror(errno));
109
110 --- origsrc/libcaca-0.99.beta18/ruby/caca-dither.c 2010-02-15 17:49:47.000000000 -0600
111 +++ src/libcaca-0.99.beta18/ruby/caca-dither.c 2012-08-24 19:06:09.521040000 -0500
112 @@ -48,7 +48,7 @@ static VALUE set_dither_palette(VALUE se
113 VALUE v, r, g, b, a;
114 int error = 0;
115
116 - if(RARRAY(palette)->len != 256)
117 + if(RARRAY_LEN(palette) != 256)
118 {
119 rb_raise(rb_eArgError, "Palette must contain 256 elements");
120 }
121 @@ -84,7 +84,7 @@ static VALUE set_dither_palette(VALUE se
122 for(i=0; i<256; i++)
123 {
124 v = rb_ary_entry(palette, i);
125 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 4))
126 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 4))
127 {
128 r = rb_ary_entry(v,0);
129 g = rb_ary_entry(v,1);
This page took 0.035985 seconds and 5 git commands to generate.