[PATCH] gdi32: Fix compile error with Fontconfig <= 2.10.91.
FC_PRGNAME is available since 2.10.92 and FC_NAMELANG is available since 2.9.91. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46296 Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/gdi32/freetype.c | 4 ++++ 1 file changed, 4 insertions(+)
+#ifdef FC_NAMELANG r = pFcPatternAddString(pat, FC_NAMELANG, (const FcChar8 *)"en-us"); if (!r) goto end; +#endif +#ifdef FC_PRGNAME r = pFcPatternAddString(pat, FC_PRGNAME, (const FcChar8 *)"wine"); if (!r) goto end; +#endif If these parameters are not essential, you can use numeric values instead, remove error checking and ifdef-ing, so it works the same way regardless of where it was built.
On Tue, Dec 18, 2018 at 11:29:20AM +0300, Nikolay Sivov wrote:
+#ifdef FC_NAMELANG r = pFcPatternAddString(pat, FC_NAMELANG, (const FcChar8 *)"en-us"); if (!r) goto end; +#endif +#ifdef FC_PRGNAME r = pFcPatternAddString(pat, FC_PRGNAME, (const FcChar8 *)"wine"); if (!r) goto end; +#endif If these parameters are not essential, you can use numeric values instead, remove error checking and ifdef-ing, so it works the same way regardless of where it was built.
I think something like: #ifndef FC_NAMELANG #define FC_NAMELANG "namelang" #endif #ifndef FC_PRGNAME #define FC_PRGNAME "prgname" #endif put after fontconfig's "MAKE_FUNCPTR"s would be the cleanest way. But yes, what happens when run with an old version of the library; does FcPatternAddString() return an error or it is ignored, and does that make the resulting font useful or not? Huw.
participants (3)
-
Akihiro Sagawa -
Huw Davies -
Nikolay Sivov