[vala] glib-2.0: Skip ObjectPath class when using dbus-glib-1



commit 5f71f9e6bdbac3bb76e312764ed3aff3c1ae36e0
Author: Jürg Billeter <j bitron ch>
Date:   Sun Jun 27 22:09:36 2010 +0200

    glib-2.0: Skip ObjectPath class when using dbus-glib-1

 compiler/valacompiler.vala |    3 +++
 vapi/glib-2.0.vapi         |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index d406d91..6374f90 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -311,6 +311,9 @@ class Vala.Compiler {
 				if (!add_package (context, package) && !add_gir (context, package)) {
 					Report.error (null, "%s not found in specified Vala API directories or GObject-Introspection GIR directories".printf (package));
 				}
+				if (context.profile == Profile.GOBJECT && package == "dbus-glib-1") {
+					context.add_define ("DBUS_GLIB");
+				}
 			}
 			packages = null;
 		}
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 3021ad9..e334bb0 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -4031,11 +4031,13 @@ namespace GLib {
 		public Variant end ();
 	}
 
+#if !DBUS_GLIB
 	[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "DBUS_TYPE_G_OBJECT_PATH", marshaller_type_name = "BOXED", get_value_function = "g_value_get_boxed", set_value_function = "g_value_set_boxed", type_signature = "o")]
 	public class ObjectPath : string {
 		[CCode (cname = "g_strdup")]
 		public ObjectPath (string path);
 	}
+#endif
 
 	[CCode (cname = "G_LIKELY", cheader_filename = "glib.h")]
 	public static bool likely (bool expression);



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