diff options
Diffstat (limited to 'ext/tk/tkutil')
-rw-r--r-- | ext/tk/tkutil/tkutil.c | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index bedf12642a..3a403e74f5 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -8,20 +8,12 @@ ************************************************/ -#define TKUTIL_RELEASE_DATE "2005-03-02" +#define TKUTIL_RELEASE_DATE "2005-03-07" #include "ruby.h" #include "rubysig.h" #include "st.h" -/* check ruby_version */ -#include "version.h" -#if RUBY_VERSION_MINOR == 9 -#define ST_FOREACH_PASS_ERR_ARG 1 /* Ruby 1.9 */ -#else -#define ST_FOREACH_PASS_ERR_ARG 0 /* Ruby 1.8 (from 2005/02/08) */ -#endif - static VALUE cMethod; static VALUE cTclTkLib; @@ -207,36 +199,12 @@ fromUTF8_toDefaultEnc(str, self) return tk_fromUTF8(1, argv, self); } - -#if ST_FOREACH_PASS_ERR_ARG -static void -hash_check(err) - int err; -{ - if (err) { - rb_raise(rb_eRuntimeError, "hash modified during iteration"); - } -} -#endif - -#if ST_FOREACH_PASS_ERR_ARG -static int -to_strkey(key, value, hash, err) - VALUE key; - VALUE value; - VALUE hash; - int err; -#else static int to_strkey(key, value, hash) VALUE key; VALUE value; VALUE hash; -#endif { -#if ST_FOREACH_PASS_ERR_ARG - hash_check(err); -#endif if (key == Qundef) return ST_CONTINUE; rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value); return ST_CHECK; @@ -484,26 +452,14 @@ assoc2kv_enc(assoc, ary, self) } } -#if ST_FOREACH_PASS_ERR_ARG -static int -push_kv(key, val, args, err) - VALUE key; - VALUE val; - VALUE args; - int err; -#else static int push_kv(key, val, args) VALUE key; VALUE val; VALUE args; -#endif { volatile VALUE ary; -#if ST_FOREACH_PASS_ERR_ARG - hash_check(err); -#endif ary = RARRAY(args)->ptr[0]; if (key == Qundef) return ST_CONTINUE; @@ -544,26 +500,14 @@ hash2kv(hash, ary, self) } } -#if ST_FOREACH_PASS_ERR_ARG -static int -push_kv_enc(key, val, args, err) - VALUE key; - VALUE val; - VALUE args; - int err; -#else static int push_kv_enc(key, val, args) VALUE key; VALUE val; VALUE args; -#endif { volatile VALUE ary; -#if ST_FOREACH_PASS_ERR_ARG - hash_check(err); -#endif ary = RARRAY(args)->ptr[0]; if (key == Qundef) return ST_CONTINUE; |