GNOME Bugzilla – Bug 618029
gdbus & gio-unix problems
Last modified: 2010-05-14 00:35:36 UTC
There are some tiny problems with gdbus and gio vs. gio-unix: a) gio/gio.h includes gdbusmessage.h. gdbusmessage.h contains: #ifdef G_OS_UNIX #include <gio/gunixfdlist.h> #endif But gunixfdlist is only available when you have added cflags from gio-unix-2.0. Therefore, when you include <gio/gio.h> in application code which uses cflags for gio-2.0 only, you get this error: ...../include/glib-2.0/gio/gdbusmessage.h:29:29: error: gio/gunixfdlist.h: No such file or directory b) gunixcredentialsmessage.h is included in gdbus_headers and thus ends up in $prefix/include/gio-2.0/gio instead of $prefix/include/gio-unix-2.0/gio where all the other unix-only headers are.
It would maybe be overkill to introduce a gunixdbusmessage.h header just for these 2 functions. A pragmatic solution would be to just move them to gunixfdlist.h. David ?
(In reply to comment #1) > It would maybe be overkill to introduce a gunixdbusmessage.h header just for > these 2 functions. A pragmatic solution would be to just move them to > gunixfdlist.h. David ? We could also just guard functions behind #ifdef __G_UNIX_FD_LIST_H__ ...
the #if G_IO_UNIX around the gunixfdlist.h include is still incorrect and will bomb if you build something on unix without gio-unix-2.0.pc
(In reply to comment #3) > the #if G_IO_UNIX around the gunixfdlist.h include is still incorrect and will > bomb if you build something on unix without gio-unix-2.0.pc That's fine, we simply don't include gunixfdlist.h from gdbusmessage.h since we're depending on the user to do it. I mean, he will need to do that anyway in order to get the GUnixFDList typedef in the first place.
Then you introduce an ordering dependency among the users includes, which is not a nice thing to do.
(In reply to comment #5) > Then you introduce an ordering dependency among the users includes, which is > not a nice thing to do. True that. Well, GUnixFDList could include gdbusmessage.h.. might be nicer than moving the GUnixFDList*-using functions to that said headerfile as suggested in comment 2. Either way, I don't think there's any way to not lose... We could also just move typedef struct _GUnixFDList GUnixFDList and (other Unix-only structs too) to giotypes.h. Technically that's kinda where they belong.
typedef struct _GUnixFDList GUnixFDList That may be the most elegant solution. Means that you get to see the type even if you don't use gio-unix, but you don't get to use it.