Project

General

Profile

Feature #10370 ยป dont_need_check_whether_rb_block_call_exists.patch

gogotanaka (Kazuki Tanaka), 10/12/2014 04:45 AM

View differences:

ext/racc/cparse/cparse.c
260 260
    return v->retval;
261 261
}
262 262

  
263
#ifdef HAVE_RB_BLOCK_CALL
264 263
static void
265 264
call_lexer(struct cparse_params *v)
266 265
{
267 266
    rb_block_call(v->lexer, v->lexmid, 0, NULL, lexer_i, v->value_v);
268 267
}
269
#else
270
static VALUE
271
lexer_iter(VALUE data)
272
{
273
    struct cparse_params *v;
274

  
275
    Data_Get_Struct(data, struct cparse_params, v);
276
    rb_funcall(v->lexer, v->lexmid, 0);
277
    return Qnil;
278
}
279

  
280
static void
281
call_lexer(struct cparse_params *v)
282
{
283
    rb_iterate(lexer_iter, v->value_v, lexer_i, v->value_v);
284
}
285
#endif
286 268

  
287 269
static VALUE
288 270
lexer_i(RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data))
ext/racc/cparse/extconf.rb
1
# $Id$
2

  
3 1
require 'mkmf'
4
have_func('rb_block_call', 'ruby/ruby.h')
5 2
create_makefile 'racc/cparse'
6
-