diff options
-rw-r--r-- | ext/-test-/cxxanyargs/extconf.rb | 15 | ||||
-rw-r--r-- | ext/-test-/cxxanyargs/failure.cpp | 13 |
2 files changed, 27 insertions, 1 deletions
diff --git a/ext/-test-/cxxanyargs/extconf.rb b/ext/-test-/cxxanyargs/extconf.rb index 7e2449a457..90ab85608a 100644 --- a/ext/-test-/cxxanyargs/extconf.rb +++ b/ext/-test-/cxxanyargs/extconf.rb @@ -22,5 +22,18 @@ begin end if ok - create_makefile("-test-/cxxanyargs") + $srcs = %w[cxxanyargs.cpp] + $cleanfiles << "failure.failed" + create_makefile("-test-/cxxanyargs") do |mk| + mk << <<MK + +cxxanyargs.#$OBJEXT: failure.failed + +failure.failed: failure.cpp +\t$(Q)$(RUBY) -rfileutils \\ +\t -e "err = IO.popen(%[$(MAKE) failure.#$OBJEXT], err:[:child, :out], &:read)" \\ +\t -e "abort err unless /rb_define_method/ =~ err" \\ +\t -e "FileUtils.touch(*ARGV)" $@ +MK + end end diff --git a/ext/-test-/cxxanyargs/failure.cpp b/ext/-test-/cxxanyargs/failure.cpp new file mode 100644 index 0000000000..039beb1633 --- /dev/null +++ b/ext/-test-/cxxanyargs/failure.cpp @@ -0,0 +1,13 @@ +#include <ruby/ruby.h> + +static VALUE +func_arg1(VALUE self, VALUE arg1) +{ + return arg1; +} + +extern "C" void +Init_failure(void) +{ + rb_define_method(rb_cObject, "arg1", func_arg1, 0); +} |