Fix compilation of libsyncthing interface tests on Windows

This commit is contained in:
Martchus 2023-12-30 19:24:28 +01:00
parent 8aefad41ab
commit ddd4f6b411
1 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,10 @@
#include <functional> #include <functional>
#include <thread> #include <thread>
#ifdef PLATFORM_WINDOWS
#include <windows.h>
#endif
using namespace std; using namespace std;
using namespace CppUtilities; using namespace CppUtilities;
using namespace LibSyncthing; using namespace LibSyncthing;
@ -57,7 +61,11 @@ CPPUNIT_TEST_SUITE_REGISTRATION(InterfaceTests);
InterfaceTests::InterfaceTests() InterfaceTests::InterfaceTests()
{ {
#ifdef PLATFORM_WINDOWS
SetEnvironmentVariableW(L"STNOUPGRADE", L"1");
#else
setenv("STNOUPGRADE", "1", 1); setenv("STNOUPGRADE", "1", 1);
#endif
} }
void InterfaceTests::setUp() void InterfaceTests::setUp()