1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2017-05-02 07:35:20 +00:00
parent 107f157289
commit 6519aba3ba
2 changed files with 8 additions and 3 deletions

View file

@ -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))

View file

@ -2963,11 +2963,11 @@ rb_str_to_dbl(VALUE str, int badcheck)
#define special_const_to_float(val, pre, post) \
switch (val) { \
case Qnil: \
rb_raise(rb_eTypeError, pre "nil" post); \
rb_raise_static(rb_eTypeError, pre "nil" post); \
case Qtrue: \
rb_raise(rb_eTypeError, pre "true" post); \
rb_raise_static(rb_eTypeError, pre "true" post); \
case Qfalse: \
rb_raise(rb_eTypeError, pre "false" post); \
rb_raise_static(rb_eTypeError, pre "false" post); \
}
static inline void