1
0
Fork 0
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:
S.H 2022-10-10 13:52:25 +09:00 committed by GitHub
parent 6c5a8c2043
commit f1c89c8147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>

18
error.c
View file

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