Hi Martin,
On 12/21/22 10:37, Martin Storsjö wrote:
Widl uses a subset of Wine headers, on top of the host's platform
headers (either Unix or Windows ones). When building widl for a
Windows target, the included Wine headers end up being preferred
over the toolchain's own platform headers.
Wine defines the __fastfail function in the winnt.h header (as
a static inline function), while mingw-w64 headers define it in
_mingw.h as a extern gnu_inline function.
When built with Clang, this combintion of an extern declaration
and static inline, ends up producing extern definitions of the
function in every compilation unit that ends up including both
headers - which ends up as linker errors due to duplicate definitions.
(GCC doesn't seem to produce any extern definitions in these cases.)
Patch the imported winnt.h from Wine, to skip the definition of
__fastfail if __MINGW_FASTFAIL_IMPL is defined (which is set by
_mingw.h).
In theory, Wine should support using its headers with mingw-w64 CRT
headers, so it may be even fine for upstream. Or maybe we could move it
from Wine winnt.h to something like corecrt.h. Anyway, I'm not sure
about upstream Wine and it seems fine to me to just commit your patch to
mingw-w64 widl for now.
Thanks,
Jacek
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public