mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
606b66db7d
TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above. * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
19 lines
295 B
C
19 lines
295 B
C
#include <ruby.h>
|
|
|
|
static VALUE
|
|
ruby_fatal(VALUE obj, VALUE msg)
|
|
{
|
|
const char *cmsg = NULL;
|
|
|
|
(void)obj;
|
|
|
|
cmsg = RSTRING_PTR(msg);
|
|
rb_fatal("%s", cmsg);
|
|
return 0; /* never reached */
|
|
}
|
|
|
|
void
|
|
Init_rb_fatal(void)
|
|
{
|
|
rb_define_method(rb_mKernel, "rb_fatal", ruby_fatal, 1);
|
|
}
|