After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768588 - enum with [DBus (use_string_marshalling=true)] should include <gio/gio.h>
enum with [DBus (use_string_marshalling=true)] should include <gio/gio.h>
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.32.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-08 19:17 UTC by Jordan Yelloz
Modified: 2016-10-08 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This is a testcase which fails to compile with valac --pkg=gio-2.0 dbenum.vala (185 bytes, text/x-vala)
2016-07-08 19:17 UTC, Jordan Yelloz
  Details
This patch adds the proper GIO includes. (1013 bytes, patch)
2016-07-08 19:19 UTC, Jordan Yelloz
committed Details | Review

Description Jordan Yelloz 2016-07-08 19:17:20 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.
Comment 1 Jordan Yelloz 2016-07-08 19:19:24 UTC
Created attachment 331109 [details] [review]
This patch adds the proper GIO includes.
Comment 2 Rico Tzschichholz 2016-10-08 20:49:44 UTC
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.