https://bugs.winehq.org/show_bug.cgi?id=47710
Bug ID: 47710 Summary: objidl.h contains invalid C++ Product: Wine Version: 4.15 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winelib Assignee: wine-bugs@winehq.org Reporter: philip.rebohle@tu-dortmund.de Distribution: ---
Hello,
as of wine 4.15, building a winelib version of DXVK fails with the following error:
/usr/include/wine/windows/objidl.h:6100:15: error: ‘union _userSTGMEDIUM::<unnamed struct>::__WIDL_objidl_generated_name_0000000C’ invalid; an anonymous struct may only have public non-static data members [-fpermissive] 6100 | union __WIDL_objidl_generated_name_0000000C { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The problem is that C++ does not allow declaring named unions or structs inside anonymous structs since it treats this as a nested type. Moreover, the anonymous struct that it is defined in seems unnecessary, although I might be missing some detail there.
Defining __WIDL_objidl_generated_name_0000000C as an empty string before including windows.h works around this problem.