Skip to content

Bundled mingw-w64-headers issues: #include windows.foundation.h from a C++ file #489

@past-due

Description

@past-due

We'd previously been using llvm-mingw 18.1.8, but since attempting to jump to llvm-mingw 20250402 with LLVM 20.1.2 we're seeing errors in the mingw-w64-headers (windows.foundation.h):

In file included from C:/llvm-mingw/include/dispatcherqueue.h:10:
In file included from C:/llvm-mingw/include/windows.system.h:276:
C:/llvm-mingw/include/windows.foundation.h:13904:13: error: redefinition of 'IReference<unsigned char>'
 13904 |             IReference<boolean > : IReference_impl<boolean >
       |             ^~~~~~~~~~~~~~~~~~~~
C:/llvm-mingw/include/windows.foundation.h:12196:13: note: previous definition is here
 12196 |             IReference<BYTE > : IReference_impl<BYTE >
       |             ^
C:/llvm-mingw/include/windows.foundation.h:13912:1: error: redefinition of '__mingw_uuidof_s<ABI::Windows::Foundation::IReference<BYTE>>'
 13912 | __CRT_UUID_DECL(__FIReference_1_boolean, 0x3c00fd60, 0x2950, 0x5939, 0xa2,0x1a, 0x2d,0x12,0xc5,0xa0,0x1b,0x8a)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/llvm-mingw/include/_mingw.h:558:23: note: expanded from macro '__CRT_UUID_DECL'
  558 |     template<> struct __mingw_uuidof_s<type> {                   \
      |                       ^~~~~~~~~~~~~~~~~~~~~~
C:/llvm-mingw/include/windows.foundation.h:12204:1: note: previous definition is here
 12204 | __CRT_UUID_DECL(__FIReference_1_BYTE, 0xe5198cc8, 0x2873, 0x55f5, 0xb0,0xa1, 0x84,0xff,0x9e,0x4a,0xad,0x62)
       | ^
C:/llvm-mingw/include/_mingw.h:558:23: note: expanded from macro '__CRT_UUID_DECL'
  558 |     template<> struct __mingw_uuidof_s<type> {                   \
      |                       ^

[...]

In file included from C:/llvm-mingw/include/dispatcherqueue.h:10:
In file included from C:/llvm-mingw/include/windows.system.h:276:
C:/llvm-mingw/include/windows.foundation.h:13912:1: error: redefinition of '__mingw_uuidof<ABI::Windows::Foundation::IReference<BYTE>>'
 13912 | __CRT_UUID_DECL(__FIReference_1_boolean, 0x3c00fd60, 0x2950, 0x5939, 0xa2,0x1a, 0x2d,0x12,0xc5,0xa0,0x1b,0x8a)
       | ^
C:/llvm-mingw/include/_mingw.h:563:38: note: expanded from macro '__CRT_UUID_DECL'
  563 |     template<> constexpr const GUID &__mingw_uuidof<type>() {    \
      |                                      ^
C:/llvm-mingw/include/windows.foundation.h:12204:1: note: previous definition is here
 12204 | __CRT_UUID_DECL(__FIReference_1_BYTE, 0xe5198cc8, 0x2873, 0x55f5, 0xb0,0xa1, 0x84,0xff,0x9e,0x4a,0xad,0x62)
       | ^
C:/llvm-mingw/include/_mingw.h:563:38: note: expanded from macro '__CRT_UUID_DECL'
  563 |     template<> constexpr const GUID &__mingw_uuidof<type>() {    \
      |                                      ^

[...]

In file included from C:/llvm-mingw/include/dispatcherqueue.h:10:
In file included from C:/llvm-mingw/include/windows.system.h:276:
C:/llvm-mingw/include/windows.foundation.h:13912:1: error: redefinition of '__mingw_uuidof<ABI::Windows::Foundation::IReference<BYTE> *>'
 13912 | __CRT_UUID_DECL(__FIReference_1_boolean, 0x3c00fd60, 0x2950, 0x5939, 0xa2,0x1a, 0x2d,0x12,0xc5,0xa0,0x1b,0x8a)
       | ^
C:/llvm-mingw/include/_mingw.h:566:38: note: expanded from macro '__CRT_UUID_DECL'
  566 |     template<> constexpr const GUID &__mingw_uuidof<type*>() {   \
      |                                      ^
C:/llvm-mingw/include/windows.foundation.h:12204:1: note: previous definition is here
 12204 | __CRT_UUID_DECL(__FIReference_1_BYTE, 0xe5198cc8, 0x2873, 0x55f5, 0xb0,0xa1, 0x84,0xff,0x9e,0x4a,0xad,0x62)
       | ^
C:/llvm-mingw/include/_mingw.h:566:38: note: expanded from macro '__CRT_UUID_DECL'
  566 |     template<> constexpr const GUID &__mingw_uuidof<type*>() {   \
      |                                      ^
4 errors generated.

(For reference, it appears the IReference<boolean > (etc) bits were added in mingw-w64/mingw-w64@77eaa95)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions