aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-02 18:22:14 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-02 18:22:14 +0300
commit2fdf31355f00996dac96794b3b5d825fe7a53aef (patch)
treec90294db4f1d122ba6dcfcdfaef8d4b528128648
parentf678526b2089826fba0299c88b9258bc48f748c4 (diff)
downloadrspamd-2fdf31355f00996dac96794b3b5d825fe7a53aef.tar.gz
rspamd-2fdf31355f00996dac96794b3b5d825fe7a53aef.zip
Compatibility with old glib versions.
-rw-r--r--src/cfg_xml.c4
-rw-r--r--src/kvstorage_sqlite.h2
-rw-r--r--src/lua/lua_regexp.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index f77bdf3aa..ef47ec0bf 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -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;
diff --git a/src/kvstorage_sqlite.h b/src/kvstorage_sqlite.h
index fda990257..59d23a3c6 100644
--- a/src/kvstorage_sqlite.h
+++ b/src/kvstorage_sqlite.h
@@ -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);
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c
index ba9a4dabc..0f443955e 100644
--- a/src/lua/lua_regexp.c
+++ b/src/lua/lua_regexp.c
@@ -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);