boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
422 stars 69 forks source link

Fix build with MinGW-w64 12+. #140

Closed yh-sb closed 12 months ago

yh-sb commented 1 year ago

For more details see: https://github.com/boostorg/stacktrace/issues/133.

Fixes the following errors with MinGW-w64 12 or higher:

D:/dev/third_party/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of 'struct __mingw_uuidof_s<IDebugClient>'
   31 |     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      |     ^~~~~~~~~~~~~~~
C:/Program Files/mydevtools/MinGW-w64/x86_64-w64-mingw32/include/dbgeng.h:262:1: note: previous definition of 'struct __mingw_uuidof_s<IDebugClient>'
  262 | __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      | ^~~~~~~~~~~~~~~
D:/dev/third_party/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient; GUID = GUID]'
   31 |     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      |     ^~~~~~~~~~~~~~~
C:/Program Files/mydevtools/MinGW-w64/x86_64-w64-mingw32/include/dbgeng.h:262:1: note: 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient; GUID = GUID]' previously declared here
  262 | __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      | ^~~~~~~~~~~~~~~
D:/dev/third_party/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient*; GUID = GUID]'
   31 |     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      |     ^~~~~~~~~~~~~~~
C:/Program Files/mydevtools/MinGW-w64/x86_64-w64-mingw32/include/dbgeng.h:262:1: note: 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient*; GUID = GUID]' previously declared here
  262 | __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      | ^~~~~~~~~~~~~~~
D:/dev/third_party/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:32:5: error: redefinition of 'struct __mingw_uuidof_s<IDebugControl>'
   32 |     __CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
      |     ^~~~~~~~~~~~~~~
C:/Program Files/mydevtools/MinGW-w64/x86_64-w64-mingw32/include/dbgeng.h:818:1: note: previous definition of 'struct __mingw_uuidof_s<IDebugControl>'
  818 | __CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
      | ^~~~~~~~~~~~~~~
D:/dev/third_party/boost/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:32:5: error: redefinition of 'constexpr const GUID& __mingw_uuidof() [with T = IDebugControl; GUID = GUID]'
   32 |     __CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
      |     ^~~~~~~~~~~~~~~
C:/Program Files/mydevtools/MinGW-w64/x86_64-w64-mingw32/include/dbgeng.h:818:1: note: 'constexpr const GUID& __mingw_uuidof() [with T = IDebugControl; GUID = GUID]' previously declared here
  818 | __CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
      | ^~~~~~~~~~~~~~~
...
apolukhin commented 12 months ago

Many thanks for the PR!