Hi Andrew,<br><br> Thanks for a revision.<br> I confirmed completion of compiling it.<br> I revised it a little, I attach a patch.<br><br>Regards,<br>Tomo<br><br><br><div class="gmail_quote">2010/11/11 Andrew Beekhof <span dir="ltr"><<a href="mailto:andrew@beekhof.net">andrew@beekhof.net</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">This might be a little better:<br>
<div class="im"><br>
diff -r dd75da218e4f <a href="http://configure.ac" target="_blank">configure.ac</a><br>
--- a/<a href="http://configure.ac" target="_blank">configure.ac</a>      Fri Oct 29 12:12:45 2010 +0200<br>
+++ b/<a href="http://configure.ac" target="_blank">configure.ac</a>      Tue Nov 09 13:20:55 2010 +0100<br>
@@ -654,7 +654,7 @@ AC_MSG_RESULT(using $GLIBCONFIG)<br>
<br>
 AC_CHECK_LIB(glib-2.0, g_hash_table_get_values)<br>
 if test "x$ac_cv_lib_glib_2_0_g_hash_table_get_values" != x""yes; then<br>
-   AC_MSG_ERROR(Your version of Glib is too old, you need at least 2.14)<br>
+   AC_MSG_WARN(Your version of Glib is too old, you should have at least 2.14)<br>
 fi<br>
<br>
 #<br>
diff -r dd75da218e4f include/crm/common/util.h<br>
--- a/include/crm/common/util.h Fri Oct 29 12:12:45 2010 +0200<br>
+++ b/include/crm/common/util.h Tue Nov 09 13:20:55 2010 +0100<br>
@@ -298,4 +298,59 @@ extern int node_score_infinity;<br>
 extern xmlNode *create_operation_update(xmlNode *parent, lrm_op_t<br>
*op, const char *caller_version, int target_rc, const char *origin,<br>
int level);<br>
 extern void free_lrm_op(lrm_op_t *op);<br>
<br>
+#if HAVE_LIBGLIB_2_0<br>
+<br>
+#else<br>
+<br>
+typedef struct fake_ghi<br>
+{<br>
+       int         offset;<br>
+       GHashTable *hash;<br>
+       GList      *values;<br>
+<br>
+} GHashTableIter;<br>
+<br>
</div>+static inline void g_hash_append_value(gpointer key, gpointer value,<br>
<div class="im">gpointer user_data)<br>
+{<br>
+    GList **values = (GList **)user_data;<br>
+    *values = g_list_append(*values, value);<br>
+}<br>
+<br>
+static inline GList *g_hash_table_get_values(GHashTable *hash_table);<br>
+{<br>
+    GList *values = NULL;<br>
+    g_hash_table_foreach(hash_table, g_hash_append_value, &values);<br>
+}<br>
+<br>
+static inline void g_hash_table_iter_init(GHashTableIter *iter,<br>
GHashTable *hash_table)<br>
+{<br>
+    iter->offset = 0;<br>
+    iter->hash = hash_table;<br>
+<br>
+    /* iter->values = g_hash_table_get_values(hash_table); */<br>
+<br>
+    /* We could cache the values, but then we need to clean up the list<br>
+     * later which doesn't fit the glib2 API<br>
+     * So instead we calculate it in _next() every time its needed<br>
+     */<br>
+}<br>
+<br>
+<br>
+static inline gboolean g_hash_table_iter_next(GHashTableIter *iter,<br>
gpointer *key, gpointer *value)<br>
+{<br>
+    GList *values = iter->values;<br>
+    if(iter->values == NULL) {<br>
</div>+       values = g_hash_table_get_values(iter->hash_table);<br>
<div class="im">+    }<br>
+<br>
+    iter->offset++;<br>
+    *value = g_list_nth_data(values, iter->offset);<br>
+<br>
+    if(iter->values == NULL) {<br>
+       g_list_free(values);<br>
+    }<br>
</div>+    return (*value) != NULL;<br>
<div><div></div><div class="h5">+}<br>
+<br>
 #endif<br>
+<br>
+#endif<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
</div></div></blockquote></div><br>