Original bugreport on RedHat Bugzilla. https://bugzilla.redhat.com/show_bug.cgi?id=980278 OS: Fedora 18. Description of problem: The current mingw header <rpc.h> pollutes the namespace with a '#define interface ...'. While this is bad practice, the dbus package should avoid the problems it causes by picking names that are less likely to collide in its function declarations, or even omitting parameter names altogether (and just declaring parameter types without names). I ran into this while trying to cross-compile libvirt for mingw. Version-Release number of selected component (if applicable): mingw32-dbus-1.6.8-1.fc18.noarch mingw32-headers-2.0.999-0.15.trunk.20121110.fc18.noarch How reproducible: 100% Steps to Reproduce: 1. cat foo.c 2. i686-w64-mingw32-gcc -c \ -I /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0 \ -I /usr/i686-w64-mingw32/sys-root/mingw/lib/dbus-1.0/include \ foo.c Actual results: 1. #include <rpc.h> #include <dbus/dbus.h> int dummy; 2. In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-connection.h:32:0, from /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-bus.h:30, from /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus.h:31, from foo.c:2: /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:74:58: error: expected ';', ',' or ')' before 'struct' /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:80:58: error: expected ';', ',' or ')' before 'struct' /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:111:58: error: expected ';', ',' or ')' before 'struct' /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:116:58: error: expected ';', ',' or ')' before 'struct' /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:149:58: error: expected ';', ',' or ')' before 'struct' /usr/i686-w64-mingw32/sys-root/mingw/include/dbus-1.0/dbus/dbus-message.h:153:58: error: expected ';', ',' or ')' before 'struct' Expected results: no compilation error
A patch that does s/interface/iface/ in function parameter names would be welcome. If 'interface' appears in contexts where it's part of the API (e.g. struct members) then, sorry, we can't fix this.
it is only in function parameters.
Created attachment 81872 [details] [review] Use iface instead of interface
Comment on attachment 81872 [details] [review] Use iface instead of interface Review of attachment 81872 [details] [review]: ----------------------------------------------------------------- Sure, I'll apply this soon.
(In reply to comment #0) > The current mingw header <rpc.h> pollutes the namespace with a '#define > interface ...'. While this is bad practice, the dbus package should avoid > the problems it causes by picking names that are less likely to collide in > its function declarations, or even omitting parameter names altogether (and > just declaring parameter types without names). General policy statement on this: Unless the other maintainers all overrule me, I am not willing to drop parameter names in general: named parameters have significant documentation value (and I suspect Doxygen uses them as input). However, 'interface' is a sufficiently widely-namespace-polluted token that I think it's worth avoiding; your patch is ideal for that (assuming it works, I haven't tried it yet :-)
So. Is the patch approved? I need to know this before rebuild Fedora package.
Yes, fixed in git for 1.7.6. Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.