$NetBSD$

--- resourcebundle/resourcebundle_iterator.c.orig	2010-03-15 23:03:30.000000000 +0100
+++ resourcebundle/resourcebundle_iterator.c
@@ -18,6 +18,8 @@
 #include <zend.h>
 #include <zend_API.h>
 
+#include "php_intl.h"
+
 #include "resourcebundle/resourcebundle.h"
 #include "resourcebundle/resourcebundle_class.h"
 #include "resourcebundle/resourcebundle_iterator.h"
@@ -75,7 +77,7 @@ static void resourcebundle_iterator_dtor
 
 	resourcebundle_iterator_invalidate( iter TSRMLS_CC );
 
-	object->refcount--;
+	Z_DELREF_P(object);
 
 	efree(iterator);
 }
@@ -162,7 +164,7 @@ zend_object_iterator *resourcebundle_get
 	     php_error( E_ERROR, "ResourceBundle does not support writable iterators" );
 	}
 
-	object->refcount++;
+	Z_DELREF_P(object);
 	iterator->intern.data = (void *) object;
 	iterator->intern.funcs = &resourcebundle_iterator_funcs;
 
