Skip to content

Commit

Permalink
Merge pull request #240 from nobu/old-checks
Browse files Browse the repository at this point in the history
Remove old checks
  • Loading branch information
nobu committed Oct 31, 2023
2 parents b8e211f + 67053ed commit 01d7bda
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
21 changes: 0 additions & 21 deletions ext/racc/cparse/cparse.c
Expand Up @@ -70,10 +70,6 @@ static ID id_d_e_pop;
# define LONG2NUM(i) INT2NUM(i)
#endif

#ifndef HAVE_RB_ARY_SUBSEQ
# define rb_ary_subseq(ary, beg, len) rb_ary_new4(len, RARRAY_PTR(ary) + beg)
#endif

static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));

Expand Down Expand Up @@ -278,28 +274,11 @@ racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid, VALUE arg, VALUE sysdebug)
return v->retval;
}

#ifdef HAVE_RB_BLOCK_CALL
static void
call_lexer(struct cparse_params *v)
{
rb_block_call(v->lexer, v->lexmid, 0, NULL, lexer_i, v->value_v);
}
#else
static VALUE
lexer_iter(VALUE data)
{
struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);

rb_funcall(v->lexer, v->lexmid, 0);
return Qnil;
}

static void
call_lexer(struct cparse_params *v)
{
rb_iterate(lexer_iter, v->value_v, lexer_i, v->value_v);
}
#endif

static VALUE
lexer_i(RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data))
Expand Down
5 changes: 1 addition & 4 deletions ext/racc/cparse/extconf.rb
@@ -1,9 +1,6 @@
# frozen_string_literal: false
# frozen_string_literal: true
#

require 'mkmf'

have_func('rb_block_call')
have_func('rb_ary_subseq')

create_makefile 'racc/cparse'

0 comments on commit 01d7bda

Please sign in to comment.