summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-10-11 12:17:23 +0200
committerJürg Billeter <j@bitron.ch>2010-10-11 12:17:23 +0200
commite823dd0468a470b25397c060bd3eb819f85957ef (patch)
tree7b85f314dfa091442a834d7dfd444c1c2e2831d6 /src
parent9adde36bdacffb320e09205e5cf2aff672e79d94 (diff)
downloadtracker-e823dd0468a470b25397c060bd3eb819f85957ef.tar.gz
SPARQL: Fix build with Vala < 0.11
Diffstat (limited to 'src')
-rw-r--r--src/libtracker-data/tracker-sparql-query.vala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 4afb9390d..462f57522 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -89,6 +89,9 @@ namespace Tracker.Sparql {
return "\"%s:%s\"".printf (sql_identifier, suffix);
}
+#if VALA_0_12
+ // GLib.HashFunc and GLib.EqualFunc are generic delegates in Vala 0.11.0 and later
+
public static bool equal (Variable a, Variable b) {
return a.index == b.index;
}
@@ -96,6 +99,15 @@ namespace Tracker.Sparql {
public static uint hash (Variable variable) {
return (uint) variable.index;
}
+#else
+ public static bool equal (void* a, void* b) {
+ return ((Variable) a).index == ((Variable) b).index;
+ }
+
+ public static uint hash (void* variable) {
+ return (uint) ((Variable) variable).index;
+ }
+#endif
}
class Context {