[PATCH v3 1/3] bus/pci: fix build with MinGW 13
Thomas Monjalon
thomas at monjalon.net
Wed Sep 10 14:59:23 CEST 2025
08/09/2025 23:17, Thomas Monjalon:
> After an upgrade to MinGW version 13, some compilation errors appear:
>
> drivers/bus/pci/windows/pci.c:362:58:
> error: 'GUID_DEVCLASS_NETUIO' undeclared
> drivers/bus/pci/windows/pci_netuio.c:57:39:
> error: 'GUID_DEVINTERFACE_NETUIO' undeclared
>
> The cause is MinGW has set NTDDI_VERSION to the highest version
> without defining the expected NETUIO constants.
>
> It is safer to not rely on Windows headers version,
> and instead define what is not already defined,
> after including Windows headers.
[...]
> -#if !defined(NTDDI_WIN10_FE) || NTDDI_VERSION < NTDDI_WIN10_FE
> -/* GUID definition for device class netUIO */
> +/* GUID_DEVCLASS_NETUIO should be defined in devguid.h */
> +#ifndef GUID_DEVCLASS_NETUIO
> DEFINE_GUID(GUID_DEVCLASS_NETUIO, 0x78912bc1, 0xcb8e, 0x4b28,
> 0xa3, 0x29, 0xf3, 0x22, 0xeb, 0xad, 0xbe, 0x0f);
> +#endif
Unfortunately it cannot work because DEFINE_GUID is declaring a variable,
not a macro.
It is sad, we have to check Windows and MinGW versions.
More information about the dev
mailing list