From 4abc14dbdd510410f35ef52939ef36f21da8e265 Mon Sep 17 00:00:00 2001 From: "benjamin.dauvergne" Date: Wed, 10 Oct 2012 10:35:15 +0000 Subject: add implementation of g_hash_table_get_keys to compile under Centos 5 git-svn-id: https://modmellon.googlecode.com/svn/trunk@171 a716ebb1-153a-0410-b759-cfb97c6a1b53 --- auth_mellon.h | 22 ++++++++++++++++++++++ configure.ac | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/auth_mellon.h b/auth_mellon.h index c1c8086..12ff5a9 100644 --- a/auth_mellon.h +++ b/auth_mellon.h @@ -370,4 +370,26 @@ int am_httpclient_post_str(request_rec *r, const char *uri, extern module AP_MODULE_DECLARE_DATA auth_mellon_module; +/* Old glib compatibility */ + +#if (GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14) + +static void g_hash_table_get_keys_helper(gpointer key, gpointer value, + gpointer user_data) +{ + GList **out = user_data; + + *out = g_list_prepend(*out, key); +} + +static GList *g_hash_table_get_keys(GHashTable *ht) +{ + GList *ret = NULL; + + g_hash_table_foreach(ht, g_hash_table_get_keys_helper, &ret); + + return g_list_reverse(ret); +} +#endif + #endif /* MOD_AUTH_MELLON_H */ diff --git a/configure.ac b/configure.ac index 4455a13..064b222 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,8 @@ PKG_CHECK_MODULES(OPENSSL, openssl) AC_SUBST(OPENSSL_CFLAGS) AC_SUBST(OPENSSL_LIBS) -# We need at least version 2.14 of GLib. -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14]) +# We need at least version 2.12 of GLib. +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12]) # Create Makefile from Makefile.in -- cgit