summaryrefslogtreecommitdiff
path: root/ext/tk/tkutil/tkutil.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-06 16:23:47 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-06 16:23:47 +0000
commit57b3ed4cda8882429590f761f9d545eee88823a3 (patch)
treecc708f4999fd0de015fcdf6da3bdd5f1c88b355b /ext/tk/tkutil/tkutil.c
parent40671c1c5d5fb6d79f55985bd0330f61b90d7502 (diff)
* ext/tk/tkutil/tkutil.c: follow the change of st.c (committed at Fri,
4 Mar 2005 15:47:47 +0900 by matz) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tkutil/tkutil.c')
-rw-r--r--ext/tk/tkutil/tkutil.c58
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;