From 691395949f3e3c1f0d064ada3b331b9c1d4e2818 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 8 Sep 2010 20:49:14 +0200 Subject: Fix compilation of Ruby plugin with ruby <= 1.8.6 (bug #30967) --- src/plugins/scripts/ruby/weechat-ruby.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/scripts') diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index 127e7fa21..951177a36 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -177,7 +177,13 @@ weechat_ruby_hash_to_hashtable (VALUE hash, int hashtable_size) if (!hashtable) return NULL; + /* RHASH_TBL exists in ruby 1.8.7 but not ruby 1.8.6 */ +#ifdef RHASH_TBL st = RHASH_TBL(hash); +#else + st = RHASH(hash)->tbl; +#endif + rb_hash_foreach (hash, &weechat_ruby_hash_foreach_cb, (unsigned long)hashtable); return hashtable; -- cgit v1.2.3