From 7585facf05d927eb6df3929ce09ed5e60d905437 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Thu, 7 Feb 2013 13:27:27 +0100 Subject: Imported Upstream version 5.0.2 --- src/dumm/ext/dumm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/dumm/ext/dumm.c') diff --git a/src/dumm/ext/dumm.c b/src/dumm/ext/dumm.c index ca9b29388..603fac088 100644 --- a/src/dumm/ext/dumm.c +++ b/src/dumm/ext/dumm.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #undef PACKAGE_NAME #undef PACKAGE_TARNAME @@ -30,6 +30,8 @@ #undef PACKAGE_STRING #undef PACKAGE_BUGREPORT #undef PACKAGE_URL +/* avoid redefintiion of snprintf etc. */ +#define RUBY_DONT_SUBST #include static dumm_t *dumm; @@ -141,7 +143,11 @@ static VALUE guest_hash(VALUE class) if (!rb_cvar_defined(class, id)) { VALUE hash = guest_hash_create(class); +#ifdef RB_CVAR_SET_4_ARGS rb_cvar_set(class, id, hash, 0); +#else + rb_cvar_set(class, id, hash); +#endif return hash; } return rb_cvar_get(class, id); @@ -627,6 +633,7 @@ static VALUE iface_each_addr(int argc, VALUE *argv, VALUE self) { rb_raise(rb_eArgError, "must be called with a block"); } + list = linked_list_create(); Data_Get_Struct(self, iface_t, iface); enumerator = iface->create_address_enumerator(iface); while (enumerator->enumerate(enumerator, &addr)) -- cgit v1.2.3