diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-25 04:54:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-25 04:54:27 +0000 |
commit | 2c183f552034ac32a026daeed2c95839fefa34b5 (patch) | |
tree | c827542161488beae9730c86dbcd9916a9654ce5 /string.c | |
parent | 5919370363cd39a04bb3e848b1e15f9c2f1b3ce3 (diff) | |
download | ruby-2c183f552034ac32a026daeed2c95839fefa34b5.tar.gz |
string.c: STRING_ENUMERATORS_WANTARRAY
* string.c (STRING_ENUMERATORS_WANTARRAY): name preprocessing
codition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -29,6 +29,8 @@ #include <unistd.h> #endif +#define STRING_ENUMERATORS_WANTARRAY 0 /* next major */ + #define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) #undef rb_str_new_cstr @@ -6115,7 +6117,7 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, int wantarray) if (rb_block_given_p()) { if (wantarray) { -#if 0 /* next major */ +#if STRING_ENUMERATORS_WANTARRAY rb_warn("given block not used"); ary = rb_ary_new(); #else @@ -6297,7 +6299,7 @@ rb_str_enumerate_bytes(VALUE str, int wantarray) if (rb_block_given_p()) { if (wantarray) { -#if 0 /* next major */ +#if STRING_ENUMERATORS_WANTARRAY rb_warn("given block not used"); ary = rb_ary_new(); #else @@ -6390,7 +6392,7 @@ rb_str_enumerate_chars(VALUE str, int wantarray) if (rb_block_given_p()) { if (wantarray) { -#if 0 /* next major */ +#if STRING_ENUMERATORS_WANTARRAY rb_warn("given block not used"); ary = rb_ary_new(); #else @@ -6493,7 +6495,7 @@ rb_str_enumerate_codepoints(VALUE str, int wantarray) if (rb_block_given_p()) { if (wantarray) { -#if 0 /* next major */ +#if STRING_ENUMERATORS_WANTARRAY rb_warn("given block not used"); ary = rb_ary_new(); #else |