summaryrefslogtreecommitdiff
path: root/ext/-test-/fatal/rb_fatal.c
blob: 71aef4658afbd6a80e05cd5e61dcb1c1a44726ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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);
}