Alexandre Julliard : winex11: Mask FPU exceptions around fontconfig calls.
Alexandre Julliard
julliard at winehq.org
Fri Oct 28 12:48:37 CDT 2011
Module: wine
Branch: master
Commit: 171183c77b2ac7c808d5090f7c46a71b7d033eb1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=171183c77b2ac7c808d5090f7c46a71b7d033eb1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 28 12:41:14 2011 +0200
winex11: Mask FPU exceptions around fontconfig calls.
---
dlls/winex11.drv/xrender.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 8ee3f59..3157d8c 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -952,11 +952,18 @@ static int GetCacheEntry( HDC hdc, LFANDSIZE *plfsz )
#ifdef SONAME_LIBFONTCONFIG
if (fontconfig_installed)
{
- FcPattern *match, *pattern = pFcPatternCreate();
+ FcPattern *match, *pattern;
FcResult result;
char family[LF_FACESIZE * 4];
+#if defined(__i386__) && defined(__GNUC__)
+ /* fontconfig generates floating point exceptions, mask them */
+ WORD cw, default_cw = 0x37f;
+ __asm__ __volatile__("fnstcw %0; fldcw %1" : "=m" (cw) : "m" (default_cw));
+#endif
+
WideCharToMultiByte( CP_UTF8, 0, plfsz->lf.lfFaceName, -1, family, sizeof(family), NULL, NULL );
+ pattern = pFcPatternCreate();
pFcPatternAddString( pattern, FC_FAMILY, (FcChar8 *)family );
if (plfsz->lf.lfWeight != FW_DONTCARE)
{
@@ -1007,6 +1014,10 @@ static int GetCacheEntry( HDC hdc, LFANDSIZE *plfsz )
pFcPatternDestroy( match );
}
pFcPatternDestroy( pattern );
+
+#if defined(__i386__) && defined(__GNUC__)
+ __asm__ __volatile__("fnclex; fldcw %0" : : "m" (cw));
+#endif
}
#endif /* SONAME_LIBFONTCONFIG */
More information about the wine-cvs
mailing list