DBus 1.4.6 and Git master build error on Windows

Andre Heinecke aheinecke at intevation.de
Mon Mar 7 05:21:24 PST 2011


Am Freitag, 4. März 2011 12:49:02 schrieb Simon McVittie:
> We could either fix this the way you suggest, or by avoiding including
> winioctl.h (directly or indirectly) in any source file that also includes
> config-parser.h. In principle only dbus-sysdeps-*.c are meant to include
> OS-dependent headers, although I don't think that's strictly enforced.
As far as I understand it the problem here is that config-parser.c itself 
includes dbus-sysdeps.h which includes dbus-sysdeps-win.h and which includes 
windows.h that finally includes winioctl.h
If you could get rid of dbus-sysdeps in config-parser that would be a good 
solution I think.

> git grep -i on the D-Bus source doesn't show me any mentions of winioctl,
> except for this ugly workaround in config.h.cmake which is only active when
> using both MSVC++ and cmake, which we can remove if this is fixed properly:
>     #ifdef _MSC_VER
>     /* avoid defines of ELEMENT_TYPE */
>     #define _WINIOCTL_
>     #endif
> Is _WINIOCTL_ a documented way to disable winioctl.h, or is this (as I
> suspect) just a hack? If it's a documented way to disable winioctl.h, we
> should make it conditional on DBUS_WIN instead of MSVC++.
No this is definitly not a good solution this is just defining the include 
guard for _WINIOCTL_ (which in mingw is _WINIOCTL_H_) If you then use a 
function from windows.h that depends on winioctl.h you have a Problem.
> Alternatively, which chain(s) of headers indirectly include winioctl.h? How
> feasible is it to just avoid config-parser and winioctl.h having to
> coexist?
See above.

> Like I said on IRC, I'd be happy enough to merge this if you amended it to
> add a comment something like this:
>   /* this is really <type>, but winioctl.h defines ELEMENT_TYPE */
Sorry missed that on IRC, attached is the amended patch.


Andre Heinecke |  ++49-541-335083-262 |  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-use-the-name-ELEMENT_TYPE.patch
Type: text/x-diff
Size: 2934 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20110307/6370cb5b/attachment.patch>

More information about the dbus mailing list