diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 15:20:15 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 15:20:15 +0000 |
commit | b20e9ebe5aea57b6f49b0d100f26967165feafca (patch) | |
tree | 604bbde5e9b5bef206661cd31e7b5b3891ded57e /internal.h | |
parent | 83b2ba3cfa9d2a3b881b6bc2fcc62072cc923d8b (diff) |
merge revision(s) 58146,58150,58156: [Backport #13276]
error.c: refactor warning messages
* error.c (with_warning_string): extract building warning message
string from variadic arguments.
* error.c (syserr_warning): write warning message with the system
error message.
error.c: warning functions
* error.c: define warning functions in all combinations of
* no errno, system errno, argument
* without/with encoding
* enabled/disabled by default
dir.c: err at glob failure
* dir.c (glob_helper): raise a SystemCallError exception when
opendir() failed, except for ENOENT, ENOTDIR, and EACCES. this
behavior predates 1.0; the comments in glob.c claimed that
glob() returned -1 on error but actualy the pointer to a global
variable, then dir_glob() did check only -1 as the comments, and
ignored actual errors. [ruby-core:80226] [Bug #13276]
dir.c: ruby_glob_funcs_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal.h b/internal.h index 45e32c35b7..cb758b94ad 100644 --- a/internal.h +++ b/internal.h @@ -1015,9 +1015,17 @@ VALUE rb_check_backtrace(VALUE); NORETURN(void rb_async_bug_errno(const char *,int)); const char *rb_builtin_type_name(int t); const char *rb_builtin_class_name(VALUE x); +PRINTF_ARGS(void rb_sys_warn(const char *fmt, ...), 1, 2); +PRINTF_ARGS(void rb_syserr_warn(int err, const char *fmt, ...), 2, 3); PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); +PRINTF_ARGS(void rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3); +PRINTF_ARGS(void rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...), 3, 4); +PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2); +PRINTF_ARGS(void rb_syserr_warning(int err, const char *fmt, ...), 2, 3); 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); + 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)) |