Hello!

The IDWriteTextLayout[1] interface inherits from the
IDWriteTextFormat[2] one.  Both declare, for example,
GetFontCollection() members.  Therefore, IDWriteTextLayout exploits C++
function overloading, which isn't available in C.

And that's where I failed: I need to compile a C code module including
dwrite.h header using CC:

$ cc -x c dwrite.h -o /dev/null 2>&1 | fgrep GetFontCollection
dwrite.h:2006:15: error: duplicate member 'GetFontCollection'
 2006 |     STDMETHOD(GetFontCollection)(THIS_

Of course, there are other "duplicated member functions" like
GetFontFamilyNameLength(), GetFontFamilyName(), etc.

How can I compile my C code?  Am I doomed to use ITypeInfo and IDispatch
for IDWriteTextLayout objects in C code?

Oh, by the way, revision 75bdd3 misses a parenthesis:

diff --git a/mingw-w64-headers/include/dwrite.h b/mingw-w64-headers/include/dwrite.h
index 9a0cc02d..943cd738 100644
--- a/mingw-w64-headers/include/dwrite.h
+++ b/mingw-w64-headers/include/dwrite.h
@@ -1430,7 +1430,7 @@ DECLARE_INTERFACE_(IDWriteLocalFontFileLoader,IDWriteFontFileLoader)
     STDMETHOD_(ULONG, Release)(THIS) PURE;

     /* IDWriteFontFileLoader methods */
- STDMETHOD(CreateStreamFromKey(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE; + STDMETHOD(CreateStreamFromKey)(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE;
 #endif

     /* IDWriteLocalFontFileLoader methods */

[1] https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextlayout [2] https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextformat


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to