Bug 35083

Summary: [cmake] nasty workaround for winioctl.h should be removed
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: normal    
Priority: medium    
Version: 1.4.x   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description Simon McVittie 2011-03-07 06:57:17 UTC
config.h.cmake has this hack:

    #ifdef _MSC_VER
    /* avoid defines of ELEMENT_TYPE */
    #define _WINIOCTL_
    #endif

which "fixes" compilation on Windows by defining the current multiple-inclusion guard for winioctl.h, but only if you're using MSVC++ and cmake; relying on an implementation detail like the exact name of a multiple-inclusion guard is ugly anyway.

Andre Heinecke has contributed a workaround that should work for all Windows compilers in both the cmake and autotools build-systems (renaming ELEMENT_TYPE to ELEMENT_CONFIGTYPE), so this hack should be removed.

Mailing list reference: http://lists.freedesktop.org/archives/dbus/2011-March/014184.html
Comment 1 Ralf Habacker 2011-05-18 13:04:26 UTC
This buf has been fixed in commit http://cgit.freedesktop.org/dbus/dbus/commit/?id=e0fc90bdf2c60a4c77fffaf490d6f06b2bd6999d and could be closed
Comment 2 Simon McVittie 2011-05-19 01:55:31 UTC
(In reply to comment #1)
> http://cgit.freedesktop.org/dbus/dbus/commit/?id=e0fc90bdf2c60a4c77fffaf490d6f06b2bd6999d

I know, I committed that patch. That's not what this bug is about, though. This bug is a request to remove this hack from config.h.cmake, which shouldn't be necessary since commit e0fc90bdf:

    #ifdef _MSC_VER
    /* avoid defines of ELEMENT_TYPE */
    #define _WINIOCTL_
    #endif

and check that that still works on Windows/MSVC/cmake (I can't test this myself, since I don't have Windows or MSVC).
Comment 3 Ralf Habacker 2011-05-22 07:50:20 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > http://cgit.freedesktop.org/dbus/dbus/commit/?id=e0fc90bdf2c60a4c77fffaf490d6f06b2bd6999d
> 
> I know, I committed that patch. That's not what this bug is about, though. This
> bug is a request to remove this hack from config.h.cmake, which shouldn't be
> necessary since commit e0fc90bdf:
> 
>     #ifdef _MSC_VER
>     /* avoid defines of ELEMENT_TYPE */
>     #define _WINIOCTL_
>     #endif
> 
> and check that that still works on Windows/MSVC/cmake (I can't test this
> myself, since I don't have Windows or MSVC).

fixed in git master

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.