tst_qlocale: only restore the fp control masks we change

Certain masks are not supported outside 32-bit x86, and will assert on
x64.

Fixes: QTBUG-106000
Change-Id: Ic9f58e5a19c1db3309edeb5ec529e7a78c929665
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 070446d5ebf2a82531160268fbae0bb7c6730ecd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2022-08-29 14:58:50 +02:00 committed by Qt Cherry-pick Bot
parent 7fbe08538a
commit 63788de25b

View File

@ -1495,8 +1495,7 @@ void tst_QLocale::fpExceptions()
# define _EM_INEXACT 0x00000001
# endif
_clearfp();
unsigned int oldbits = _controlfp(0, 0);
_controlfp( 0 | _EM_INEXACT, _MCW_EM );
unsigned int oldbits = _controlfp(0 | _EM_INEXACT, _MCW_EM);
#endif
#ifdef QT_USE_FENV
@ -1514,7 +1513,7 @@ void tst_QLocale::fpExceptions()
#ifdef Q_OS_WIN
_clearfp();
_controlfp(oldbits, 0xFFFFF);
_controlfp(oldbits, _MCW_EM);
#endif
#ifdef QT_USE_FENV