Skip to content

Commit 0be03c7

Browse files
Qt: Use _putenv_s instead of setenv on Windows builds
1 parent 6adc3a3 commit 0be03c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/qt/test/test_main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ int main(int argc, char *argv[])
5959
// Prefer the "minimal" platform for the test instead of the normal default
6060
// platform ("xcb", "windows", or "cocoa") so tests can't unintentially
6161
// interfere with any background GUIs and don't require extra resources.
62-
setenv("QT_QPA_PLATFORM", "minimal", 0);
62+
#if defined(WIN32)
63+
_putenv_s("QT_QPA_PLATFORM", "minimal");
64+
#else
65+
setenv("QT_QPA_PLATFORM", "minimal", 0);
66+
#endif
6367

6468
// Don't remove this, it's needed to access
6569
// QApplication:: and QCoreApplication:: in the tests

0 commit comments

Comments
 (0)