[vala] compiler: Automatically define GLIB_2_XX if --target-glib is used



commit cde5dc4f43654b60a14efc0cd8934663b794b4d1
Author: Sebastian Dröge <sebastian droege collabora co uk>
Date:   Thu Mar 25 16:34:45 2010 +0100

    compiler: Automatically define GLIB_2_XX if --target-glib is used

 compiler/valacompiler.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index a006dae..3d2a098 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -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")) {



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