mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Reuse with_warning_string_from
macro
This commit is contained in:
parent
6c5a8c2043
commit
f1c89c8147
Notes:
git
2022-10-10 13:52:48 +09:00
Merged: https://github.com/ruby/ruby/pull/6471 Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 6 additions and 12 deletions
18
error.c
18
error.c
|
@ -511,12 +511,9 @@ rb_warn_deprecated(const char *fmt, const char *suggest, ...)
|
|||
{
|
||||
if (!deprecation_warning_enabled()) return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, suggest);
|
||||
VALUE mesg = warning_string(0, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
warn_deprecated(mesg, NULL, suggest);
|
||||
with_warning_string_from(mesg, 0, fmt, suggest) {
|
||||
warn_deprecated(mesg, NULL, suggest);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -524,12 +521,9 @@ rb_warn_deprecated_to_remove(const char *removal, const char *fmt, const char *s
|
|||
{
|
||||
if (!deprecation_warning_enabled()) return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, suggest);
|
||||
VALUE mesg = warning_string(0, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
warn_deprecated(mesg, removal, suggest);
|
||||
with_warning_string_from(mesg, 0, fmt, suggest) {
|
||||
warn_deprecated(mesg, removal, suggest);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
Loading…
Reference in a new issue