diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2008-04-02 17:44:06 +0000 |
---|---|---|
committer | Dom Lachowicz <domlachowicz@gmail.com> | 2008-04-02 17:44:06 +0000 |
commit | 30a9b92b49f6a86efffadac93cdb6e6d8eaefe27 (patch) | |
tree | f7dad3e5c0adf1a054d3df96e71a779f1947104a | |
parent | 92aa826bd48075189c5f079eacf6b138b91b1b56 (diff) | |
download | enchant-30a9b92b49f6a86efffadac93cdb6e6d8eaefe27.tar.gz |
g_hash_table_get_keys only exists for glib >= 2.14. we don't want to require something that recent, so emulate it on older systems. untested, but it's straight-forward and compiles...
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@23320 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r-- | src/pwl.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -875,6 +875,23 @@ static EnchantTrie* enchant_trie_insert(EnchantTrie* trie,const char *const word return trie; } +#if !GLIB_CHECK_VERSION(2,14,0) +static void grab_keys (gpointer key, + gpointer value, + gpointer user_data) +{ + GList **l = user_data; + *l = g_list_prepend (*l, key); +} + +static GList* g_hash_table_get_keys (GHashTable *hash_table) +{ + GList *l = NULL; + g_hash_table_foreach (hash_table, grab_keys, &l); + return l; +} +#endif + static void enchant_trie_remove(EnchantTrie* trie,const char *const word) { char *tmpWord; |