[tracker/rss-enclosures] SPARQL: Fix build with Vala < 0.11



commit 93a40a772522af3870d78e527aa5e673aa380203
Author: Jürg Billeter <j bitron ch>
Date:   Mon Oct 11 12:17:23 2010 +0200

    SPARQL: Fix build with Vala < 0.11

 src/libtracker-data/tracker-sparql-query.vala |   12 ++++++++++++
 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 4afb939..462f575 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 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]