]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
driver/0.18.x: Add support for vala-0.17.1+
authorFlorian Brosch <flo.brosch@gmail.com>
Thu, 14 Jun 2012 14:48:10 +0000 (16:48 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Thu, 14 Jun 2012 14:48:10 +0000 (16:48 +0200)
configure.in
src/driver/0.18.x/Makefile.am
src/driver/0.18.x/treebuilder.vala
src/driver/Makefile.am

index 488792919c8a966218eedeb7289b468edc681065..38bb5f9b65c29ea1a0a61575dc5faa9acc7a8006 100644 (file)
@@ -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)
index c8ee3fd0c42a8c1db3c8f9f4cba62b7d4c0fc1f8..9958cf36c82064ca88bd8ab1753707919432461b 100644 (file)
@@ -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)
 
index 3a1fb0385b87dae1af28b0458baa544219069f95..dcfae0bd0602041628b9c676e3de44496426f3f1 100644 (file)
@@ -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
                        }
                }
 
index ada5a150eddb5b757124fcee19a0fa9bafb423bc..34f992dfeff95f553844913971ac2bd234de292b 100644 (file)
@@ -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