summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-02 07:35:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-02 07:35:20 +0000
commit6519aba3ba013974d63fbf5bf25b90279f412a90 (patch)
tree514f565d9e4bf7c667f073668d0842d4dacc471f /internal.h
parent107f15728973488ce54bf299751d28236f75a8f4 (diff)
internal.h: rb_raise_static
* internal.h (rb_raise_static): raise with a static message string literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index cab6c8a545..6b9c9011c3 100644
--- a/internal.h
+++ b/internal.h
@@ -1131,6 +1131,11 @@ PRINTF_ARGS(void rb_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
+#define rb_raise_cstr(etype, mesg) \
+ rb_exc_raise(rb_exc_new_str(etype, rb_str_new_cstr(mesg)))
+#define rb_raise_static(etype, mesg) \
+ rb_exc_raise(rb_exc_new_str(etype, rb_str_new_static(mesg, rb_strlen_lit(mesg))))
+
VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
#define rb_name_err_raise_str(mesg, recv, name) \
rb_exc_raise(rb_name_err_new(mesg, recv, name))