Disable security warnings from MSVC in tests

MSVC generates the following for those tests:
warning C4996: '_open': This function or variable may be unsafe. Consider using _sopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.

We need to set the define before any C runtime headers are included, so
do it right away, it doesn't do any harm on other compilers.

Change-Id: Ia25afb87934058c3f27e63820eeb2db063a627f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Volker Hilsheimer 2021-03-17 12:01:06 +01:00
parent fac23d695f
commit 5a2ee82f2c
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,8 @@
**
****************************************************************************/
#define _CRT_SECURE_NO_WARNINGS 1
#include <QTest>
#include <QScopedValueRollback>
#include <qplatformdefs.h>

View File

@ -26,6 +26,8 @@
**
****************************************************************************/
#define _CRT_SECURE_NO_WARNINGS 1
#include <QtCore/QString>
#include <QTest>
#include <QtCore/private/qipaddress_p.h>