]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
compiler: Automatically define GLIB_2_XX if --target-glib is used
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 25 Mar 2010 15:34:45 +0000 (16:34 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 25 Mar 2010 15:41:04 +0000 (16:41 +0100)
compiler/valacompiler.vala

index a006dae7312b9fedb144d419071e49dbc0835f9c..3d2a09837856b2694976f18e6ec9d6dbafac0a0d 100644 (file)
@@ -282,6 +282,10 @@ class Vala.Compiler {
                                Report.error (null, "This version of valac only supports GLib 2");
                        }
 
+                       for (int i = 16; i <= glib_minor; i += 2) {
+                               context.add_define ("GLIB_2_%d".printf (i));
+                       }
+
                        if (!nostdpkg) {
                                /* default packages */
                                if (!add_package (context, "glib-2.0")) {