diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index bf2b9c210a..25a5f416b2 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1434,19 +1434,18 @@ void tst_QLocale::testInfAndNan() void tst_QLocale::fpExceptions() { -#ifndef _MCW_EM -#define _MCW_EM 0x0008001F -#endif -#ifndef _EM_INEXACT -#define _EM_INEXACT 0x00000001 -#endif - - // check that double-to-string conversion doesn't throw floating point exceptions when they are - // enabled + // Check that double-to-string conversion doesn't throw floating point + // exceptions when they are enabled. #ifdef Q_OS_WIN - _clear87(); - unsigned int oldbits = _control87(0, 0); - _control87( 0 | _EM_INEXACT, _MCW_EM ); +# ifndef _MCW_EM +# define _MCW_EM 0x0008001F +# endif +# ifndef _EM_INEXACT +# define _EM_INEXACT 0x00000001 +# endif + _clearfp(); + unsigned int oldbits = _controlfp(0, 0); + _controlfp( 0 | _EM_INEXACT, _MCW_EM ); #endif #ifdef QT_USE_FENV @@ -1463,8 +1462,8 @@ void tst_QLocale::fpExceptions() QVERIFY(true); #ifdef Q_OS_WIN - _clear87(); - _control87(oldbits, 0xFFFFF); + _clearfp(); + _controlfp(oldbits, 0xFFFFF); #endif #ifdef QT_USE_FENV