1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/-test-/fatal/rb_fatal.c
Nobuyoshi Nakada 590dc06e38 Get rid of defining methods for tests in core classes
Not to interfere in other tests.
2021-01-09 22:38:06 +09:00

20 lines
341 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)
{
VALUE mBug = rb_define_module("Bug");
rb_define_singleton_method(mBug, "rb_fatal", ruby_fatal, 1);
}