[tracker] libtracker-common: Fix build on maemo



commit d029b30a11d5eb144be4b14d6aaebadcc88500ae
Author: Jürg Billeter <j bitron ch>
Date:   Fri Jul 24 15:04:02 2009 +0200

    libtracker-common: Fix build on maemo

 src/libtracker-common/Makefile.am                 |    3 +-
 src/libtracker-common/posix.vapi                  |   25 +++++++++++++++++++++
 src/libtracker-common/tracker-sparql-builder.vala |    5 +---
 3 files changed, 28 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index fb35aa5..7587e81 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -107,7 +107,7 @@ libtracker_commoninclude_HEADERS =			\
 	tracker-utils.h
 
 libtracker-common.vala.stamp: $(libtracker_common_la_VALASOURCES)
-	$(VALAC) -C $(VALAFLAGS) -H tracker-sparql-builder.h $^
+	$(VALAC) -C $(VALAFLAGS) -H tracker-sparql-builder.h posix.vapi $^
 	touch $@
 
 libtracker_common_la_LDFLAGS = 				\
@@ -148,5 +148,6 @@ EXTRA_DIST = 						\
 	tracker-marshal.list				\
 	$(libtracker_common_la_VALASOURCES)		\
 	libtracker-common.vala.stamp			\
+	posix.vapi					\
 	libtracker-common.vapi
 
diff --git a/src/libtracker-common/posix.vapi b/src/libtracker-common/posix.vapi
new file mode 100644
index 0000000..92836b6
--- /dev/null
+++ b/src/libtracker-common/posix.vapi
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+[CCode (cprefix = "", lower_case_cprefix = "")]
+namespace Posix {
+	[CCode (cheader_filename = "string.h")]
+	public static size_t strcspn (string s1, string s2);
+}
+
diff --git a/src/libtracker-common/tracker-sparql-builder.vala b/src/libtracker-common/tracker-sparql-builder.vala
index a28e0d5..36c3bd9 100644
--- a/src/libtracker-common/tracker-sparql-builder.vala
+++ b/src/libtracker-common/tracker-sparql-builder.vala
@@ -17,9 +17,6 @@
  * Boston, MA  02110-1301, USA.
  */
 
-[CCode (cname = "strcspn", cheader_filename = "string.h")]
-extern static size_t strcspn (string s1, string s2);
-
 public class Tracker.SparqlBuilder : Object {
 	enum State {
 		UPDATE,
@@ -127,7 +124,7 @@ public class Tracker.SparqlBuilder : Object {
 
 		char* p = literal;
 		while (*p != '\0') {
-			size_t len = strcspn ((string) p, "\t\n\r\"\\");
+			size_t len = Posix.strcspn ((string) p, "\t\n\r\"\\");
 			str.append_len ((string) p, (long) len);
 			p += len;
 			switch (*p) {



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