]> source.dussan.org Git - rspamd.git/commitdiff
Compatibility with old glib versions.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 2 Nov 2011 15:22:14 +0000 (18:22 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 2 Nov 2011 15:22:14 +0000 (18:22 +0300)
src/cfg_xml.c
src/kvstorage_sqlite.h
src/lua/lua_regexp.c

index f77bdf3aa60ba0e19f96bd9be9a0df2db0f7680b..ef47ec0bf0524d88d971c79a5b22a377f9f57a0f 100644 (file)
@@ -1734,11 +1734,13 @@ rspamd_xml_start_element (GMarkupParseContext *context, const gchar *element_nam
                                /* Create object */
                                ud->section_pointer = init_view (ud->cfg->cfg_pool);
                        }
+#if GLIB_MINOR_VERSION >= 18
                        else if (subparsers != NULL && (subparser = g_hash_table_lookup (subparsers, element_name)) != NULL) {
                                ud->state = XML_SUBPARSER;
                                g_markup_parse_context_push (context, subparser->parser, subparser->user_data);
                                rspamd_strlcpy (ud->section_name, element_name, sizeof (ud->section_name));
                        }
+#endif
                        else {
                                /* Extract other tags */
                                rspamd_strlcpy (ud->section_name, element_name, sizeof (ud->section_name));
@@ -1932,6 +1934,7 @@ rspamd_xml_end_element (GMarkupParseContext       *context, const gchar *element_name,
                        break;
                case XML_SKIP_ELEMENTS:
                        return;
+#if GLIB_MINOR_VERSION >= 18
                case XML_SUBPARSER:
                        CHECK_TAG (ud->section_name, TRUE);
                        if (subparsers != NULL && (subparser = g_hash_table_lookup (subparsers, element_name)) != NULL) {
@@ -1944,6 +1947,7 @@ rspamd_xml_end_element (GMarkupParseContext       *context, const gchar *element_name,
                        }
                        ud->state = XML_READ_PARAM;
                        break;
+#endif
                default:
                        ud->state = XML_ERROR;
                        break;
index fda9902577677eefacd6d12fa37c57710d0a3e32..59d23a3c61ea40eb7866a9d84a55249d4b1c1db4 100644 (file)
@@ -28,7 +28,7 @@
 #include "config.h"
 #include "kvstorage.h"
 
-#ifdef WITH_DB
+#ifdef WITH_SQLITE
 
 /* Create new bdb backend */
 struct rspamd_kv_backend* rspamd_kv_sqlite_new (const gchar *filename, guint sync_ops);
index ba9a4dabcc872adbc9997f9dfffe3494c9c7de3f..0f443955eb484576f5d4781d401ef3d3f2aad4e6 100644 (file)
@@ -160,6 +160,7 @@ lua_regexp_match (lua_State *L)
        if (re) {
                data = luaL_checkstring (L, 2);
                if (data) {
+#if GLIB_MINOR_VERSION >= 26
                        if ((g_regex_get_compile_flags (re) & G_REGEX_RAW) == 0) {
                                /* Validate input */
                                if (!g_utf8_validate (data, -1, NULL)) {
@@ -167,6 +168,7 @@ lua_regexp_match (lua_State *L)
                                        return 1;
                                }
                        }
+#endif
                        if (g_regex_match_full (re, data, -1, 0, 0, &mi, NULL)) {
                                matches = g_match_info_fetch_all (mi);
                                lua_newtable (L);