forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qdbm-ruby19.patch
373 lines (344 loc) · 9.88 KB
/
qdbm-ruby19.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
--- a/ruby/Makefile.in
+++ b/ruby/Makefile.in
@@ -85,27 +85,27 @@
sync ; sync
cd depot && rm -rf casket
cd depot && \
- $(RUNENV) ruby -w -Ilib rbdptest write casket 10000 1000
+ $(RUNENV) ruby -w -Ilib -I. rbdptest write casket 10000 1000
cd depot && \
- $(RUNENV) ruby -w -Ilib rbdptest read casket
+ $(RUNENV) ruby -w -Ilib -I. rbdptest read casket
cd depot && \
- $(RUNENV) ruby -w -Ilib rbdptest misc casket
+ $(RUNENV) ruby -w -Ilib -I. rbdptest misc casket
cd depot && rm -rf casket
cd curia && rm -rf casket
cd curia && \
- $(RUNENV) ruby -w -Ilib rbcrtest write casket 10000 1000 10
+ $(RUNENV) ruby -w -Ilib -I. rbcrtest write casket 10000 1000 10
cd curia && \
- $(RUNENV) ruby -w -Ilib rbcrtest read casket
+ $(RUNENV) ruby -w -Ilib -I. rbcrtest read casket
cd curia && \
- $(RUNENV) ruby -w -Ilib rbcrtest misc casket
+ $(RUNENV) ruby -w -Ilib -I. rbcrtest misc casket
cd curia && rm -rf casket
cd villa && rm -rf casket
cd villa && \
- $(RUNENV) ruby -w -Ilib rbvltest write casket 10000
+ $(RUNENV) ruby -w -Ilib -I. rbvltest write casket 10000
cd villa && \
- $(RUNENV) ruby -w -Ilib rbvltest read casket
+ $(RUNENV) ruby -w -Ilib -I. rbvltest read casket
cd villa && \
- $(RUNENV) ruby -w -Ilib rbvltest misc casket
+ $(RUNENV) ruby -w -Ilib -I. rbvltest misc casket
cd villa && rm -rf casket
@printf '\n'
@printf '#================================================================\n'
--- a/ruby/configure.in
+++ b/ruby/configure.in
@@ -17,7 +17,7 @@
# Setting the default prefix
if test "$prefix" = NONE
then
- prefix=`ruby -rrbconfig -e 'puts(Config::CONFIG.fetch("prefix"))'`
+ prefix=`ruby -rrbconfig -e 'puts(RbConfig::CONFIG.fetch("prefix"))'`
fi
# Duplication of QDBM for Ruby
--- a/ruby/curia/mod_curia.c
+++ b/ruby/curia/mod_curia.c
@@ -24,6 +24,13 @@
#define MAXOPEN 1024
+#ifndef StringValuePtr
+# define StringValuePtr(v) STR2CSTR(v)
+#endif
+#ifndef RSTRING_LEN
+# define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
VALUE ccuriaerror;
VALUE ccuriaerror_ENOERR;
@@ -233,7 +240,7 @@
const char *name;
int index, omode, bnum, dnum;
if((index = getnewindex()) == -1) myerror(DP_EMISC);
- name = STR2CSTR(vname);
+ name = StringValuePtr(vname);
FIXNUM_P(vomode);
omode = FIX2INT(vomode);
FIXNUM_P(vbnum);
@@ -276,10 +283,10 @@
int index, ksiz, vsiz, dmode;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
- vbuf = STR2CSTR(vval);
- vsiz = RSTRING(vval)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
+ vbuf = StringValuePtr(vval);
+ vsiz = RSTRING_LEN(vval);
FIXNUM_P(vdmode);
dmode = FIX2INT(vdmode);
curia = crtable[index];
@@ -297,8 +304,8 @@
int index, ksiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
curia = crtable[index];
if(!crout(curia, kbuf, ksiz)){
if(crsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
@@ -316,8 +323,8 @@
VALUE vval;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
FIXNUM_P(vstart);
start = FIX2INT(vstart);
FIXNUM_P(vmax);
@@ -339,8 +346,8 @@
int index, ksiz, vsiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
curia = crtable[index];
if((vsiz = crvsiz(curia, kbuf, ksiz)) == -1){
if(crsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
--- a/ruby/curia/rbcrtest
+++ b/ruby/curia/rbcrtest
@@ -21,7 +21,7 @@
# main routine
def main()
- $0.gsub!(/.*\//, "")
+ $0 = $0.gsub(/.*\//, "")
(ARGV.length >= 1) || usage()
if(ARGV[0] == "write")
rv = runwrite()
@@ -283,7 +283,7 @@
# execute main
-$0.gsub!(/.*\//, "")
+$0 = $0.gsub(/.*\//, "")
exit(main())
--- a/ruby/depot/mod_depot.c
+++ b/ruby/depot/mod_depot.c
@@ -23,6 +23,13 @@
#define MAXOPEN 1024
+#ifndef StringValuePtr
+# define StringValuePtr(v) STR2CSTR(v)
+#endif
+#ifndef RSTRING_LEN
+# define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
VALUE cdepoterror;
VALUE cdepoterror_ENOERR;
@@ -232,7 +239,7 @@
const char *name;
int index, omode, bnum;
if((index = getnewindex()) == -1) myerror(DP_EMISC);
- name = STR2CSTR(vname);
+ name = StringValuePtr(vname);
FIXNUM_P(vomode);
omode = FIX2INT(vomode);
FIXNUM_P(vbnum);
@@ -273,10 +280,10 @@
int index, ksiz, vsiz, dmode;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
- vbuf = STR2CSTR(vval);
- vsiz = RSTRING(vval)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
+ vbuf = StringValuePtr(vval);
+ vsiz = RSTRING_LEN(vval);
FIXNUM_P(vdmode);
dmode = FIX2INT(vdmode);
depot = dptable[index];
@@ -294,8 +301,8 @@
int index, ksiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
depot = dptable[index];
if(!dpout(depot, kbuf, ksiz)){
if(dpsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
@@ -313,8 +320,8 @@
VALUE vval;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
FIXNUM_P(vstart);
start = FIX2INT(vstart);
FIXNUM_P(vmax);
@@ -336,8 +343,8 @@
int index, ksiz, vsiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
depot = dptable[index];
if((vsiz = dpvsiz(depot, kbuf, ksiz)) == -1){
if(dpsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
--- a/ruby/depot/rbdptest
+++ b/ruby/depot/rbdptest
@@ -21,7 +21,7 @@
# main routine
def main()
- $0.gsub!(/.*\//, "")
+ $0 = $0.gsub(/.*\//, "")
(ARGV.length >= 1) || usage()
if(ARGV[0] == "write")
rv = runwrite()
@@ -278,7 +278,7 @@
# execute main
-$0.gsub!(/.*\//, "")
+$0 = $0.gsub(/.*\//, "")
exit(main())
--- a/ruby/myrbdoc
+++ b/ruby/myrbdoc
@@ -186,7 +186,7 @@
# execute main
-#$0.gsub!(/.*\//, "")
+#$0 = $0.gsub(/.*\//, "")
exit(main())
--- a/ruby/villa/mod_villa.c
+++ b/ruby/villa/mod_villa.c
@@ -25,6 +25,13 @@
#define MAXOPEN 1024
+#ifndef StringValuePtr
+# define StringValuePtr(v) STR2CSTR(v)
+#endif
+#ifndef RSTRING_LEN
+# define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
VALUE cvillaerror;
VALUE cvillaerror_ENOERR;
@@ -304,7 +311,7 @@
int index, omode, cmode;
VLCFUNC cmp;
if((index = getnewindex()) == -1) myerror(DP_EMISC);
- name = STR2CSTR(vname);
+ name = StringValuePtr(vname);
FIXNUM_P(vomode);
omode = FIX2INT(vomode);
FIXNUM_P(vcmode);
@@ -352,10 +359,10 @@
int index, ksiz, vsiz, dmode;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
- vbuf = STR2CSTR(vval);
- vsiz = RSTRING(vval)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
+ vbuf = StringValuePtr(vval);
+ vsiz = RSTRING_LEN(vval);
FIXNUM_P(vdmode);
dmode = FIX2INT(vdmode);
villa = vltable[index];
@@ -373,8 +380,8 @@
int index, ksiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
villa = vltable[index];
if(!vlout(villa, kbuf, ksiz)){
if(vlsltable[index] && dpecode == DP_ENOITEM) return Qfalse;
@@ -391,8 +398,8 @@
VALUE vval;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
villa = vltable[index];
if(!(vbuf = vlget(villa, kbuf, ksiz, &vsiz))){
if(vlsltable[index] && dpecode == DP_ENOITEM) return Qnil;
@@ -409,8 +416,8 @@
int index, ksiz, vsiz;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
villa = vltable[index];
if((vsiz = vlvsiz(villa, kbuf, ksiz)) == -1){
if(vlsltable[index] && dpecode == DP_ENOITEM) return INT2FIX(-1);
@@ -426,8 +433,8 @@
int index, ksiz, vnum;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
villa = vltable[index];
vnum = vlvnum(villa, kbuf, ksiz);
return INT2FIX(vnum);
@@ -497,8 +504,8 @@
VALUE vval;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- kbuf = STR2CSTR(vkey);
- ksiz = RSTRING(vkey)->len;
+ kbuf = StringValuePtr(vkey);
+ ksiz = RSTRING_LEN(vkey);
FIXNUM_P(vjmode);
jmode = FIX2INT(vjmode);
villa = vltable[index];
@@ -551,8 +558,8 @@
int index, vsiz, cpmode;
FIXNUM_P(vindex);
if((index = FIX2INT(vindex)) == -1) myerror(DP_EMISC);
- vbuf = STR2CSTR(vval);
- vsiz = RSTRING(vval)->len;
+ vbuf = StringValuePtr(vval);
+ vsiz = RSTRING_LEN(vval);
FIXNUM_P(vcpmode);
cpmode = FIX2INT(vcpmode);
villa = vltable[index];
--- a/ruby/villa/rbvltest
+++ b/ruby/villa/rbvltest
@@ -21,7 +21,7 @@
# main routine
def main()
- $0.gsub!(/.*\//, "")
+ $0 = $0.gsub(/.*\//, "")
(ARGV.length >= 1) || usage()
if(ARGV[0] == "write")
rv = runwrite()
@@ -280,7 +280,7 @@
# execute main
-$0.gsub!(/.*\//, "")
+$0 = $0.gsub(/.*\//, "")
exit(main())