On Mon Aug 21 06:04:43 2023 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/3607/diffs?diff_id=63811&start_sha=bc05fdc1ecf0f8c7be624903fff3d68dd6d00296#b9f3fcb0d009a2e0280a996be40ed7b3570192c7_146_0)
I remembered that there was an MR that wanted to add dxcore for MinGW, but I don't personally use MinGW myself.
I tried adding the template wrappers using cpp_quote but the built header had them outside the interface block.
``` [ local, object, uuid(526c7776-40e9-459b-b711-f32ad76dfc28), ] interface IDXCoreAdapterList : IUnknown { HRESULT GetAdapter(uint32_t index, REFIID riid, [out, iid_is(riid)] void **ppv); uint32_t GetAdapterCount(); BOOL IsStale(); HRESULT GetFactory(REFIID riid, [out, iid_is(riid)] void **ppv); HRESULT Sort(uint32_t num_preferences, const DXCoreAdapterPreference *preferences); BOOL IsAdapterPreferenceSupported(DXCoreAdapterPreference preference);
cpp_quote("#ifdef __cplusplus") cpp_quote("template<class T> HRESULT STDMETHODCALLTYPE GetAdapter(uint32_t index, T **ppv)") cpp_quote("{") cpp_quote(" return GetAdapter(index, IID_PPV_ARGS(ppvAdapter));") cpp_quote("}") cpp_quote("template <class T> HRESULT GetFactory(T **ppv)") cpp_quote("{") cpp_quote(" return GetFactory(IID_PPV_ARGS(ppvFactory));") cpp_quote("}") cpp_quote("#endif") }; ``` Resulted in:
``` #ifdef __cplusplus template<class T> HRESULT STDMETHODCALLTYPE GetAdapter(uint32_t index, T **ppv) { return GetAdapter(index, IID_PPV_ARGS(ppvAdapter)); } template <class T> HRESULT GetFactory(T **ppv) { return GetFactory(IID_PPV_ARGS(ppvFactory)); } #endif DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7,0x11, 0xf3,0x2a,0xd7,0x6d,0xfc,0x28); #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28") IDXCoreAdapterList : public IUnknown { virtual HRESULT STDMETHODCALLTYPE GetAdapter( uint32_t index, REFIID riid, void **ppv) = 0;
virtual uint32_t STDMETHODCALLTYPE GetAdapterCount( ) = 0;
virtual BOOL STDMETHODCALLTYPE IsStale( ) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFactory( REFIID riid, void **ppv) = 0;
virtual HRESULT STDMETHODCALLTYPE Sort( uint32_t num_preferences, const DXCoreAdapterPreference *preferences) = 0;
virtual BOOL STDMETHODCALLTYPE IsAdapterPreferenceSupported( DXCoreAdapterPreference preference) = 0;
}; ``` I didn't see a way around it without manually hard-coding the lines for C++, which was not worth it at that point.