Please try the attached patch. This is only a draft and contains some bad formatting.
-- Best regards, LIU Hao
From a3c58b63fe49883797ed2a505e82d85455f28913 Mon Sep 17 00:00:00 2001 From: LIU Hao <lh_mo...@126.com> Date: Wed, 17 Aug 2022 09:23:16 +0800 Subject: [PATCH] make `_COM_SMARTPTR_TYPEDEF` work inside a class --- mingw-w64-headers/include/comdef.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mingw-w64-headers/include/comdef.h b/mingw-w64-headers/include/comdef.h index cb785f8f6..aae8470d7 100644 --- a/mingw-w64-headers/include/comdef.h +++ b/mingw-w64-headers/include/comdef.h @@ -197,7 +197,9 @@ typedef int __missing_type__; #if defined(_COM_SMARTPTR_LEVEL2) #ifdef __CRT_UUID_DECL /* With our __uuidof, its result can't be passed directly as a template argument. We have _com_IIID_getter to work around that. */ -#define _COM_SMARTPTR_TYPEDEF(Interface,aIID) inline const IID &__##Interface##_IID_getter(void) { return aIID; } typedef _COM_SMARTPTR< _com_IIID_getter<Interface, __##Interface##_IID_getter > > Interface ## Ptr +#define _COM_SMARTPTR_TYPEDEF(Interface,aIID) \ +struct __##Interface##_IID_getter_type { static const IID& __get_IID() throw() { return aIID; } }; \ +typedef _COM_SMARTPTR< _com_IIID_getter<Interface, __##Interface##_IID_getter_type::__get_IID > > Interface ## Ptr #else #define _COM_SMARTPTR_TYPEDEF(Interface,IID) typedef _COM_SMARTPTR< _COM_SMARTPTR_LEVEL2<Interface, &IID > > Interface ## Ptr #endif -- 2.25.1
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public