GNOME Bugzilla – Bug 768588
enum with [DBus (use_string_marshalling=true)] should include <gio/gio.h>
Last modified: 2016-10-08 20:49:48 UTC
Created attachment 331108 [details] This is a testcase which fails to compile with valac --pkg=gio-2.0 dbenum.vala A single enum with DBus string marshalling enabled in a vala source file with no other GIO accesses currently will not include gio/gio.h even though the marshallers use GIO symbols. The code generator should at least include gio headers. It would also be better if the parser produced an error if GIO wasn't added to the build flags, similar to an async method without gio.
Created attachment 331109 [details] [review] This patch adds the proper GIO includes.
commit ed3d936aaf368705c9d2a504797a110b2f03abec Author: Jordan Yelloz <jordan@yelloz.me> Date: Fri Jul 8 11:41:35 2016 -0700 codegen: Include gio/gio.h for "use_string_marshalling" Using [DBus (use_string_marshalling = true)] requires G_DBUS_ERROR symbols and therefore needs gio/gio.h while e.g. defining enum in dedicated file.