[valadoc] driver/0.18.x: Add support for vala-0.17.1+



commit 1f9fb52c7c71ad74b48797f1655ca5b7636e77c3
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Jun 14 16:48:10 2012 +0200

    driver/0.18.x: Add support for vala-0.17.1+

 configure.in                       |    8 +++++++-
 src/driver/0.18.x/Makefile.am      |    9 +++++++++
 src/driver/0.18.x/treebuilder.vala |   24 ++++++++++++++++++++++++
 src/driver/Makefile.am             |    4 ++++
 4 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 4887929..38bb5f9 100644
--- a/configure.in
+++ b/configure.in
@@ -62,12 +62,18 @@ AC_SUBST(LIBGDKPIXBUF_LIBS)
 ## Drivers:
 ##
 
-PKG_CHECK_MODULES(LIBVALA_0_18_X, libvala-0.18 >= 0.17.0, have_libvala_0_18_x="yes", have_libvala_0_18_x="no")
+PKG_CHECK_MODULES(LIBVALA_0_18_X, libvala-0.18 >= 0.17.1, have_libvala_0_18_x="yes", have_libvala_0_18_x="no")
 AM_CONDITIONAL(HAVE_LIBVALA_0_18_X, test "$have_libvala_0_18_x" = "yes")
 AC_SUBST(LIBVALA_0_18_X_CFLAGS)
 AC_SUBST(LIBVALA_0_18_X_LIBS)
 
 
+PKG_CHECK_MODULES(LIBVALA_0_17_0, libvala-0.18 = 0.17.0, have_libvala_0_17_0="yes", have_libvala_0_17_0="no")
+AM_CONDITIONAL(HAVE_LIBVALA_0_17_0, test "$have_libvala_0_17_0" = "yes")
+AC_SUBST(LIBVALA_0_17_0_CFLAGS)
+AC_SUBST(LIBVALA_0_17_0_LIBS)
+
+
 PKG_CHECK_MODULES(LIBVALA_0_16_X, libvala-0.16 >= 0.15.1, have_libvala_0_16_x="yes", have_libvala_0_16_x="no")
 AM_CONDITIONAL(HAVE_LIBVALA_0_16_X, test "$have_libvala_0_16_x" = "yes")
 AC_SUBST(LIBVALA_0_16_X_CFLAGS)
diff --git a/src/driver/0.18.x/Makefile.am b/src/driver/0.18.x/Makefile.am
index c8ee3fd..9958cf3 100644
--- a/src/driver/0.18.x/Makefile.am
+++ b/src/driver/0.18.x/Makefile.am
@@ -5,6 +5,11 @@ NULL =
 VERSIONED_VAPI_DIR=`pkg-config libvala-0.18 --variable vapidir`
 
 
+if HAVE_LIBVALA_0_17_0
+VALA_FLAGS = -D VALA_0_17_0
+endif
+
+
 
 AM_CFLAGS =  -g \
 	-DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
@@ -12,6 +17,8 @@ AM_CFLAGS =  -g \
 	$(GLIB_CFLAGS) \
 	$(LIBGEE_CFLAGS) \
 	$(LIBVALA_0_18_X_CFLAGS) \
+	$(LIBVALA_0_17_1_CFLAGS) \
+	$(LIBVALA_0_17_0_CFLAGS) \
 	$(NULL)
 
 
@@ -54,6 +61,8 @@ libdriver_la_LIBADD = \
 	../../libvaladoc/libvaladoc.la \
 	$(GLIB_LIBS) \
 	$(LIBVALA_0_18_X_LIBS) \
+	$(LIBVALA_0_17_1_LIBS) \
+	$(LIBVALA_0_17_0_LIBS) \
 	$(LIBGEE_LIBS) \
 	$(NULL)
 
diff --git a/src/driver/0.18.x/treebuilder.vala b/src/driver/0.18.x/treebuilder.vala
index 3a1fb03..dcfae0b 100644
--- a/src/driver/0.18.x/treebuilder.vala
+++ b/src/driver/0.18.x/treebuilder.vala
@@ -83,9 +83,17 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 					if (c.source_reference.file == vns.source_reference.file) {
 						Vala.SourceReference pos = c.source_reference;
 						if (c is Vala.GirComment) {
+#if VALA_0_17_0
 							comment = new GirSourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+#else
+							comment = new GirSourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+#endif
 						} else {
+#if VALA_0_17_0
 							comment = new SourceComment (c.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+#else
+							comment = new SourceComment (c.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+#endif
 						}
 						break;
 					}
@@ -295,22 +303,38 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
 			Vala.SourceReference pos = comment.source_reference;
 			SourceFile file = files.get (pos.file);
 			if (comment is Vala.GirComment) {
+#if VALA_0_17_0
 				var tmp = new GirSourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+#else
+				var tmp = new GirSourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+#endif
 				if (((Vala.GirComment) comment).return_content != null) {
 					Vala.SourceReference return_pos = ((Vala.GirComment) comment).return_content.source_reference;
+#if VALA_0_17_0
 					tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.first_line, return_pos.first_column, return_pos.last_line, return_pos.last_column);
+#else
+					tmp.return_comment = new SourceComment (((Vala.GirComment) comment).return_content.content, file, return_pos.begin.line, return_pos.begin.column, return_pos.end.line, return_pos.end.column);
+#endif
 				}
 
 				Vala.MapIterator<string, Vala.Comment> it = ((Vala.GirComment) comment).parameter_iterator ();
 				while (it.next ()) {
 					Vala.Comment vala_param = it.get_value ();
 					Vala.SourceReference param_pos = vala_param.source_reference;
+#if VALA_0_17_0
 					var param_comment = new SourceComment (vala_param.content, file, param_pos.first_line, param_pos.first_column, param_pos.last_line, param_pos.last_column);
+#else
+					var param_comment = new SourceComment (vala_param.content, file, param_pos.begin.line, param_pos.begin.column, param_pos.end.line, param_pos.end.column);
+#endif
 					tmp.add_parameter_content (it.get_key (), param_comment);
 				}
 				return tmp;
 			} else {
+#if VALA_0_17_0
 				return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+#else
+				return new SourceComment (comment.content, file, pos.begin.line, pos.begin.column, pos.end.line, pos.end.column);
+#endif
 			}
 		}
 
diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am
index ada5a15..34f992d 100644
--- a/src/driver/Makefile.am
+++ b/src/driver/Makefile.am
@@ -34,6 +34,10 @@ if HAVE_LIBVALA_0_16_X
 DRIVER_0_16_X_DIR = 0.16.x
 endif
 
+if HAVE_LIBVALA_0_17_0
+DRIVER_0_18_X_DIR = 0.18.x
+endif
+
 if HAVE_LIBVALA_0_18_X
 DRIVER_0_18_X_DIR = 0.18.x
 endif



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