From 725626d8905fe1ac4a2cf1c3e2db6412bf8f381f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 18 Aug 2022 11:37:54 +0900 Subject: [Bug #18964] Update the code range of appended portion --- ext/-test-/econv/append.c | 15 +++++++++++++++ ext/-test-/econv/extconf.rb | 3 +++ ext/-test-/econv/init.c | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 ext/-test-/econv/append.c create mode 100644 ext/-test-/econv/extconf.rb create mode 100644 ext/-test-/econv/init.c (limited to 'ext/-test-') diff --git a/ext/-test-/econv/append.c b/ext/-test-/econv/append.c new file mode 100644 index 0000000000..724cd136c0 --- /dev/null +++ b/ext/-test-/econv/append.c @@ -0,0 +1,15 @@ +#include "ruby/ruby.h" +#include "ruby/encoding.h" + +static VALUE +econv_append(VALUE self, VALUE src, VALUE dst) +{ + rb_econv_t *ec = DATA_PTR(self); + return rb_econv_str_append(ec, src, dst, 0); +} + +void +Init_econv_append(VALUE klass) +{ + rb_define_method(klass, "append", econv_append, 2); +} diff --git a/ext/-test-/econv/extconf.rb b/ext/-test-/econv/extconf.rb new file mode 100644 index 0000000000..d786b15db9 --- /dev/null +++ b/ext/-test-/econv/extconf.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: false +require_relative "../auto_ext.rb" +auto_ext(inc: true) diff --git a/ext/-test-/econv/init.c b/ext/-test-/econv/init.c new file mode 100644 index 0000000000..9772ebe71c --- /dev/null +++ b/ext/-test-/econv/init.c @@ -0,0 +1,11 @@ +#include "ruby.h" + +#define init(n) {void Init_econv_##n(VALUE klass); Init_econv_##n(klass);} + +void +Init_econv(void) +{ + VALUE mBug = rb_define_module("Bug"); + VALUE klass = rb_define_class_under(mBug, "EConv", rb_path2class("Encoding::Converter")); + TEST_INIT_FUNCS(init); +} -- cgit v1.2.1