diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 02:27:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 02:27:41 +0000 |
commit | 91e305bcda2e669cd4196b8e0103fb441fa4cc6e (patch) | |
tree | 896820572b9df379a6199e980e65a21e01f7c0a3 | |
parent | 9631e3e788f95449d4b81395889c07670ef2dc82 (diff) | |
download | ruby-91e305bcda2e669cd4196b8e0103fb441fa4cc6e.tar.gz |
ruby/io.h: deprecate old macros
* include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
deprecate old macros for compatibility for ruby 1.8 and older.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/pty/pty.c | 4 | ||||
-rw-r--r-- | ext/stringio/stringio.c | 4 | ||||
-rw-r--r-- | include/ruby/io.h | 4 |
5 files changed, 13 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Fri Oct 10 11:27:49 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags): + deprecate old macros for compatibility for ruby 1.8 and older. + Thu Oct 9 23:31:47 2014 Naohisa Goto <ngotogenome@gmail.com> * bignum.c (absint_numwords_generic): set an array element after @@ -244,6 +244,8 @@ with all sufficient information, see the ChangeLog file. rb_big2str0 : internal function. no replacement. rb_big2ulong_pack -> rb_integer_pack rb_gc_set_params : internal function. no replacement. + rb_io_mode_flags -> rb_io_modestr_fmode + rb_io_modenum_flags -> rb_io_oflags_fmode * struct RBignum is hidden. [Feature #6083] Use rb_integer_pack and rb_integer_unpack instead. diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 3ea5d5c8ce..18983f40b1 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -590,11 +590,11 @@ pty_getpty(int argc, VALUE *argv, VALUE self) establishShell(argc, argv, &info, SlaveName); - rfptr->mode = rb_io_mode_flags("r"); + rfptr->mode = rb_io_modestr_fmode("r"); rfptr->fd = info.fd; rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName)); - wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; + wfptr->mode = rb_io_modestr_fmode("w") | FMODE_SYNC; wfptr->fd = rb_cloexec_dup(info.fd); if (wfptr->fd == -1) rb_sys_fail("dup()"); diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index bf39a874a3..ae3843041e 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -186,12 +186,12 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self) case 2: if (FIXNUM_P(mode)) { int flags = FIX2INT(mode); - ptr->flags = rb_io_modenum_flags(flags); + ptr->flags = rb_io_oflags_fmode(flags); trunc = flags & O_TRUNC; } else { const char *m = StringValueCStr(mode); - ptr->flags = rb_io_mode_flags(m); + ptr->flags = rb_io_modestr_fmode(m); trunc = *m == 'w'; } StringValue(string); diff --git a/include/ruby/io.h b/include/ruby/io.h index cc3f5e60b1..f71176043f 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -188,8 +188,8 @@ int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding ** ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size); /* compatibility for ruby 1.8 and older */ -#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr) -#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags) +#define rb_io_mode_flags(modestr) [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">] +#define rb_io_modenum_flags(oflags) [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">] VALUE rb_io_taint_check(VALUE); NORETURN(void rb_eof_error(void)); |