From 30d1beba4d8ab3db48fd7bf8d6cc63d565c20e9c Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 3 Nov 2021 09:25:54 +0100 Subject: Removed if-def ZEN_PLATFORM_WINDOWS as its covered by WITH_COMPUTE now --- zenserver/compute/apply.cpp | 22 +++++++--------------- zenserver/testing/launch.cpp | 30 +++++++----------------------- zenserver/zenserver.cpp | 1 + 3 files changed, 15 insertions(+), 38 deletions(-) diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp index e1ab7c984..4a92b9968 100644 --- a/zenserver/compute/apply.cpp +++ b/zenserver/compute/apply.cpp @@ -17,17 +17,15 @@ #include #include -#if ZEN_PLATFORM_WINDOWS -# include +#include ZEN_THIRD_PARTY_INCLUDES_START -# include -# include -# include -# include -# pragma comment(lib, "UserEnv.lib") -# include +#include +#include +#include +#include +#pragma comment(lib, "UserEnv.lib") +#include ZEN_THIRD_PARTY_INCLUDES_END -#endif #include #include @@ -36,7 +34,6 @@ using namespace std::literals; namespace zen { -#if ZEN_PLATFORM_WINDOWS struct BasicFunctionJob { public: @@ -136,11 +133,9 @@ BasicFunctionJob::ExitCode() return gsl::narrow_cast(Ec); } -#endif //////////////////////////////////////////////////////////////////////////////// -#if ZEN_PLATFORM_WINDOWS struct SandboxedFunctionJob { SandboxedFunctionJob() = default; @@ -330,7 +325,6 @@ SandboxedFunctionJob::SpawnJob(std::filesystem::path ExePath) return true; } -#endif //////////////////////////////////////////////////////////////////////////////// @@ -772,7 +766,6 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) std::string_view ExecPath = Desc["path"].AsString(); std::filesystem::path ExePath = SandboxPath / ExecPath; -#if ZEN_PLATFORM_WINDOWS WideStringBuilder<512> CommandLine; CommandLine.Append(L'"'); CommandLine.Append(ExePath.c_str()); @@ -819,7 +812,6 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) GetExitCodeProcess(ProcessInformation.hProcess, &ExitCode); // Gather outputs -#endif // ZEN_PLATFORM_WINDOWS FileContents OutputData = zen::ReadFile(SandboxPath / "build.output"); diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 8e58b481e..013aa28b8 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -11,20 +11,17 @@ #include #include #include +#include #include -#if ZEN_PLATFORM_WINDOWS -# include - ZEN_THIRD_PARTY_INCLUDES_START -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include ZEN_THIRD_PARTY_INCLUDES_END -# pragma comment(lib, "UserEnv.lib") -#endif +#pragma comment(lib, "UserEnv.lib") #include #include @@ -33,7 +30,6 @@ using namespace std::literals; namespace zen { -#if ZEN_PLATFORM_WINDOWS struct BasicJob { public: @@ -133,19 +129,9 @@ BasicJob::ExitCode() return gsl::narrow_cast(Ec); } -#else - struct BasicJob - { - void SetWorkingDirectory(...); - void SpawnJob(...); - void Wait(); - int32_t ExitCode(); - }; -#endif // ZEN_PLATFORM_WINDOWS //////////////////////////////////////////////////////////////////////////////// -#if ZEN_PLATFORM_WINDOWS struct SandboxedJob { SandboxedJob() = default; @@ -335,8 +321,6 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath) return true; } -#else -#endif // ZEN_PLATFORM_WINDOWS //////////////////////////////////////////////////////////////////////////////// diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index 06f3911ec..d8f213e56 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -743,6 +743,7 @@ ZenServer::InitializeStructuredCache(ZenServiceConfig& ServiceConfig) } // namespace zen #if ZEN_PLATFORM_WINDOWS + class ZenWindowsService : public WindowsService { public: -- cgit v1.2.3