summaryrefslogtreecommitdiff
path: root/ext/tk/tkutil.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-06 16:24:43 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-06 16:24:43 +0000
commit1c536c2a98fabbe6e5af65eea61617e2df06091c (patch)
treeec341becfd913a58cce5b51a942a0100358e13eb /ext/tk/tkutil.c
parent3c5da1721b861a34b2c6027d1f134686b041b17c (diff)
* ext/tk/tkutil.c: remove the some codes which depend on the
defference between Ruby1.8 and 1.9, because st.c on Ruby1.9 was changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tkutil.c')
-rw-r--r--ext/tk/tkutil.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c
index bedf12642a..3a403e74f5 100644
--- a/ext/tk/tkutil.c
+++ b/ext/tk/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;