From ddd4f6b411cc1aba17db5011c60521eb2dc3f694 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 30 Dec 2023 19:24:28 +0100 Subject: [PATCH] Fix compilation of libsyncthing interface tests on Windows --- syncthing/tests/interfacetests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/syncthing/tests/interfacetests.cpp b/syncthing/tests/interfacetests.cpp index 8e701d8..4dd618b 100644 --- a/syncthing/tests/interfacetests.cpp +++ b/syncthing/tests/interfacetests.cpp @@ -16,6 +16,10 @@ #include #include +#ifdef PLATFORM_WINDOWS +#include +#endif + using namespace std; using namespace CppUtilities; using namespace LibSyncthing; @@ -57,7 +61,11 @@ CPPUNIT_TEST_SUITE_REGISTRATION(InterfaceTests); InterfaceTests::InterfaceTests() { +#ifdef PLATFORM_WINDOWS + SetEnvironmentVariableW(L"STNOUPGRADE", L"1"); +#else setenv("STNOUPGRADE", "1", 1); +#endif } void InterfaceTests::setUp()