diff options
Diffstat (limited to 'zenserver')
| -rw-r--r-- | zenserver/admin/admin.cpp | 2 | ||||
| -rw-r--r-- | zenserver/cache/structuredcache.cpp | 2 | ||||
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 5 | ||||
| -rw-r--r-- | zenserver/cache/structuredcachestore.h | 9 | ||||
| -rw-r--r-- | zenserver/casstore.cpp | 3 | ||||
| -rw-r--r-- | zenserver/compute/apply.cpp | 33 | ||||
| -rw-r--r-- | zenserver/config.cpp | 22 | ||||
| -rw-r--r-- | zenserver/config.h | 1 | ||||
| -rw-r--r-- | zenserver/experimental/frontend.cpp | 2 | ||||
| -rw-r--r-- | zenserver/experimental/usnjournal.cpp | 4 | ||||
| -rw-r--r-- | zenserver/experimental/usnjournal.h | 4 | ||||
| -rw-r--r-- | zenserver/projectstore.cpp | 33 | ||||
| -rw-r--r-- | zenserver/projectstore.h | 1 | ||||
| -rw-r--r-- | zenserver/testing/launch.cpp | 53 | ||||
| -rw-r--r-- | zenserver/upstream/upstreamcache.cpp | 12 | ||||
| -rw-r--r-- | zenserver/upstream/zen.h | 6 | ||||
| -rw-r--r-- | zenserver/windows/service.cpp | 4 | ||||
| -rw-r--r-- | zenserver/zenserver.cpp | 7 |
18 files changed, 150 insertions, 53 deletions
diff --git a/zenserver/admin/admin.cpp b/zenserver/admin/admin.cpp index 07211cbeb..44406fa70 100644 --- a/zenserver/admin/admin.cpp +++ b/zenserver/admin/admin.cpp @@ -1,7 +1,5 @@ // Copyright Epic Games, Inc. All Rights Reserved. -#pragma once - #include "admin.h" #include <zencore/compactbinarybuilder.h> diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp index 35cb02cbb..0debea3c6 100644 --- a/zenserver/cache/structuredcache.cpp +++ b/zenserver/cache/structuredcache.cpp @@ -10,7 +10,7 @@ #include <zencore/stream.h> #include <zencore/timer.h> #include <zenhttp/httpserver.h> -#include <zenstore/CAS.h> +#include <zenstore/cas.h> #include "monitoring/httpstats.h" #include "structuredcache.h" diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index e1d77a088..6f13ca1b0 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -3,7 +3,6 @@ #include "structuredcachestore.h" #include <zencore/except.h> -#include <zencore/windows.h> #include <zencore/compactbinary.h> #include <zencore/compactbinarybuilder.h> @@ -24,6 +23,10 @@ #include <zenstore/cidstore.h> #include <zenstore/gc.h> +#if ZEN_PLATFORM_WINDOWS +# include <zencore/windows.h> +#endif + #include <concepts> #include <filesystem> #include <ranges> diff --git a/zenserver/cache/structuredcachestore.h b/zenserver/cache/structuredcachestore.h index 760f4995c..ac5642a21 100644 --- a/zenserver/cache/structuredcachestore.h +++ b/zenserver/cache/structuredcachestore.h @@ -9,10 +9,9 @@ #include <zencore/uid.h> #include <zenstore/cas.h> -#pragma warning(push) -#pragma warning(disable : 4127) +ZEN_THIRD_PARTY_INCLUDES_START #include <tsl/robin_map.h> -#pragma warning(pop) +ZEN_THIRD_PARTY_INCLUDES_END #include <compare> #include <filesystem> @@ -117,7 +116,9 @@ private: /** A cache bucket manages a single directory containing metadata and data for that bucket */ - struct CacheBucket; + struct CacheBucket + { + }; std::filesystem::path m_RootDir; RwLock m_Lock; diff --git a/zenserver/casstore.cpp b/zenserver/casstore.cpp index 88525bd36..872a40df8 100644 --- a/zenserver/casstore.cpp +++ b/zenserver/casstore.cpp @@ -51,6 +51,9 @@ HttpCasService::HttpCasService(CasStore& Store) : m_CasStore(Store) return ServerRequest.WriteResponse(HttpResponseCode::OK); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPut | HttpVerb::kHead); diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp index 053c262c2..6669108d2 100644 --- a/zenserver/compute/apply.cpp +++ b/zenserver/compute/apply.cpp @@ -12,11 +12,11 @@ #include <zencore/iobuffer.h> #include <zencore/iohash.h> #include <zencore/scopeguard.h> -#include <zencore/windows.h> -#include <zenstore/CAS.h> +#include <zenstore/cas.h> #include <zenstore/cidstore.h> #if ZEN_PLATFORM_WINDOWS +# include <zencore/windows.h> ZEN_THIRD_PARTY_INCLUDES_START # include <AccCtrl.h> # include <AclAPI.h> @@ -34,6 +34,7 @@ using namespace std::literals; namespace zen { +#if ZEN_PLATFORM_WINDOWS struct BasicFunctionJob { public: @@ -133,7 +134,11 @@ BasicFunctionJob::ExitCode() return gsl::narrow_cast<int>(Ec); } +#endif + +//////////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_WINDOWS struct SandboxedFunctionJob { SandboxedFunctionJob() = default; @@ -323,6 +328,9 @@ SandboxedFunctionJob::SpawnJob(std::filesystem::path ExePath) return true; } +#endif + +//////////////////////////////////////////////////////////////////////////////// HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, const std::filesystem::path& BaseDir) : m_Log(logging::Get("apply")) @@ -434,6 +442,8 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, SharedBuffer Decompressed = DataView.Decompress(); const uint64_t DecompressedSize = DataView.GetRawSize(); + ZEN_UNUSED(DataHash); + TotalAttachmentBytes += DecompressedSize; ++AttachmentCount; @@ -464,9 +474,15 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, return HttpReq.WriteResponse(HttpResponseCode::NoContent); } break; + + default: + break; } } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -483,6 +499,9 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, case HttpVerb::kPost: break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -580,6 +599,8 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, const IoHash DataHash = Attachment.GetHash(); CompressedBuffer DataView = Attachment.AsCompressedBinary(); + ZEN_UNUSED(DataHash); + const uint64_t CompressedSize = DataView.GetCompressedSize(); TotalAttachmentBytes += CompressedSize; @@ -605,8 +626,14 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, return HttpReq.WriteResponse(HttpResponseCode::OK, Output); } break; + + default: + break; } break; + + default: + break; } }, HttpVerb::kPost); @@ -743,6 +770,7 @@ 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()); @@ -789,6 +817,7 @@ 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/config.cpp b/zenserver/config.cpp index f512f8015..94226ef26 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -9,16 +9,16 @@ #include <zencore/string.h> #include <zenhttp/zenhttp.h> -#pragma warning(push) -#pragma warning(disable : 4267) // warning C4267: '=': conversion from 'size_t' to 'US', possible loss of data +ZEN_THIRD_PARTY_INCLUDES_START #include <cxxopts.hpp> -#pragma warning(pop) - #include <fmt/format.h> #include <zencore/logging.h> #include <sol/sol.hpp> +ZEN_THIRD_PARTY_INCLUDES_END -#include <conio.h> +#if ZEN_PLATFORM_WINDOWS +# include <conio.h> +#endif #if ZEN_PLATFORM_WINDOWS @@ -260,8 +260,13 @@ ParseGlobalCliOptions(int argc, char* argv[], ZenServerOptions& GlobalOptions, Z if (result.count("help")) { zen::logging::ConsoleLog().info("{}", options.help()); +#if ZEN_PLATFORM_WINDOWS zen::logging::ConsoleLog().info("Press any key to exit!"); _getch(); +#else + // Assume the user's in a terminal on all other platforms and that + // they'll use less/more/etc. if need be. +#endif exit(0); } @@ -286,7 +291,7 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv using namespace fmt::literals; std::filesystem::path ConfigScript = DataRoot / "zen_cfg.lua"; - zen::IoBuffer LuaScript = zen::IoBufferBuilder::MakeFromFile(ConfigScript.native().c_str()); + zen::IoBuffer LuaScript = zen::IoBufferBuilder::MakeFromFile(ConfigScript); if (LuaScript) { @@ -301,6 +306,7 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv // any more than it needs to lua.set_function("getenv", [&](const std::string env) -> sol::object { +#if ZEN_PLATFORM_WINDOWS std::wstring EnvVarValue; size_t RequiredSize = 0; std::wstring EnvWide = zen::Utf8ToWide(env); @@ -312,6 +318,10 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv EnvVarValue.resize(RequiredSize); _wgetenv_s(&RequiredSize, EnvVarValue.data(), RequiredSize, EnvWide.c_str()); return sol::make_object(lua, zen::WideToUtf8(EnvVarValue.c_str())); +#else + ZEN_UNUSED(env); + return sol::make_object(lua, sol::lua_nil); +#endif }); try diff --git a/zenserver/config.h b/zenserver/config.h index 72a4f31bb..55e846352 100644 --- a/zenserver/config.h +++ b/zenserver/config.h @@ -4,6 +4,7 @@ #include <filesystem> #include <string> +#include <vector> #ifndef ZEN_ENABLE_MESH # define ZEN_ENABLE_MESH 0 diff --git a/zenserver/experimental/frontend.cpp b/zenserver/experimental/frontend.cpp index 98d570cfe..4bd3ec90a 100644 --- a/zenserver/experimental/frontend.cpp +++ b/zenserver/experimental/frontend.cpp @@ -54,7 +54,7 @@ body { <pre> __________ _________ __ \____ / ____ ____ / _____/_/ |_ ____ _______ ____ - / / _/ __ \ / \ \_____ \ \ __\ / _ \ \_ __ \_/ __ \ + / / _/ __ \ / \ \_____ \ \ __\ / _ \ \_ __ \_/ __ \ / /_ \ ___/ | | \ / \ | | ( <_> ) | | \/\ ___/ /_______ \ \___ >|___| //_______ / |__| \____/ |__| \___ > \/ \/ \/ \/ \/ diff --git a/zenserver/experimental/usnjournal.cpp b/zenserver/experimental/usnjournal.cpp index 9422dd485..95f75cea5 100644 --- a/zenserver/experimental/usnjournal.cpp +++ b/zenserver/experimental/usnjournal.cpp @@ -1,5 +1,7 @@ // Copyright Epic Games, Inc. All Rights Reserved. +#if ZEN_PLATFORM_WINDOWS + #include "usnjournal.h" #include <zencore/except.h> @@ -344,3 +346,5 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath) } } // namespace zen + +#endif // ZEN_PLATFORM_WINDOWS diff --git a/zenserver/experimental/usnjournal.h b/zenserver/experimental/usnjournal.h index db1f59abc..2f666383b 100644 --- a/zenserver/experimental/usnjournal.h +++ b/zenserver/experimental/usnjournal.h @@ -2,6 +2,8 @@ #pragma once +#if ZEN_PLATFORM_WINDOWS + #include <zencore/windows.h> #include <zencore/zencore.h> @@ -63,3 +65,5 @@ private: }; } // namespace zen + +#endif // ZEN_PLATFORM_WINDOWS diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp index 73d61c124..ba51a0dd2 100644 --- a/zenserver/projectstore.cpp +++ b/zenserver/projectstore.cpp @@ -11,11 +11,14 @@ #include <zencore/stream.h> #include <zencore/string.h> #include <zencore/timer.h> -#include <zencore/windows.h> #include <zenstore/basicfile.h> #include <zenstore/cas.h> #include <zenstore/caslog.h> +#if ZEN_PLATFORM_WINDOWS +# include <zencore/windows.h> +#endif + #define USE_ROCKSDB 0 #if USE_ROCKSDB @@ -114,7 +117,7 @@ struct ProjectStore::OplogStorage : public RefCounted #if USE_ROCKSDB { - std::string RocksdbPath = WideToUtf8((m_OplogStoragePath / "ops.rdb").native().c_str()); + std::string RocksdbPath = ToUtf8(m_OplogStoragePath / "ops.rdb"); ZEN_DEBUG("opening rocksdb db at '{}'", RocksdbPath); @@ -184,8 +187,8 @@ struct ProjectStore::OplogStorage : public RefCounted CbObject Op(SharedBuffer::MakeView(OpBuffer.Data(), OpBuffer.Size())); m_NextOpsOffset = - Max(m_NextOpsOffset.load(std::memory_order::memory_order_relaxed), RoundUp(OpFileOffset + LogEntry.OpCoreSize, m_OpsAlign)); - m_MaxLsn = Max(m_MaxLsn.load(std::memory_order::memory_order_relaxed), LogEntry.OpLsn); + Max(m_NextOpsOffset.load(std::memory_order_relaxed), RoundUp(OpFileOffset + LogEntry.OpCoreSize, m_OpsAlign)); + m_MaxLsn = Max(m_MaxLsn.load(std::memory_order_relaxed), LogEntry.OpLsn); Handler(Op, LogEntry); }); @@ -275,8 +278,8 @@ private: ProjectStore::Oplog::Oplog(std::string_view Id, Project* Project, CidStore& Store, std::filesystem::path BasePath) : m_OuterProject(Project) , m_CidStore(Store) -, m_OplogId(Id) , m_BasePath(BasePath) +, m_OplogId(Id) { m_Storage = new OplogStorage(this, m_BasePath); const bool StoreExists = m_Storage->Exists(); @@ -331,7 +334,7 @@ ProjectStore::Oplog::FindChunk(Oid ChunkId) std::filesystem::path FilePath = m_OuterProject->RootDir / FileIt->second.ServerPath; - IoBuffer FileChunk = IoBufferBuilder::MakeFromFile(FilePath.native().c_str()); + IoBuffer FileChunk = IoBufferBuilder::MakeFromFile(FilePath); FileChunk.SetContentType(ZenContentType::kBinary); return FileChunk; @@ -626,7 +629,7 @@ ProjectStore::Project::Write() CbObjectWriter Cfg; Cfg << "id" << Identifier; - Cfg << "root" << WideToUtf8(RootDir.c_str()); + Cfg << "root" << ToUtf8(RootDir); Cfg << "project" << ProjectRootDir; Cfg << "engine" << EngineRootDir; @@ -725,8 +728,6 @@ ProjectStore::Project::OpenOplog(std::string_view OplogId) void ProjectStore::Project::DeleteOplog(std::string_view OplogId) { - bool Exists = false; - { RwLock::ExclusiveLockScope _(m_ProjectLock); @@ -734,8 +735,6 @@ ProjectStore::Project::DeleteOplog(std::string_view OplogId) if (OplogIt != m_Oplogs.end()) { - Exists = true; - m_Oplogs.erase(OplogIt); } } @@ -776,8 +775,8 @@ ProjectStore::Project::Scrub(ScrubContext& Ctx) ProjectStore::ProjectStore(CidStore& Store, std::filesystem::path BasePath) : m_Log(zen::logging::Get("project")) -, m_ProjectBasePath(BasePath) , m_CidStore(Store) +, m_ProjectBasePath(BasePath) { ZEN_INFO("initializing project store at '{}'", BasePath); // m_Log.set_level(spdlog::level::debug); @@ -1492,7 +1491,7 @@ HttpProjectService::HttpProjectService(CidStore& Store, ProjectStore* Projects) ProjectStore::Oplog& Log = *OplogIt; CbObjectWriter Cb; - Cb << "id"sv << Log.OplogId() << "project"sv << Prj.Identifier << "tempdir"sv << Log.TempDir(); + Cb << "id"sv << Log.OplogId() << "project"sv << Prj.Identifier << "tempdir"sv << Log.TempPath().c_str(); Req.ServerRequest().WriteResponse(HttpResponseCode::OK, Cb.Save()); } @@ -1531,6 +1530,9 @@ HttpProjectService::HttpProjectService(CidStore& Store, ProjectStore* Projects) return Req.ServerRequest().WriteResponse(HttpResponseCode::OK); } break; + + default: + break; } }, HttpVerb::kPost | HttpVerb::kGet | HttpVerb::kDelete); @@ -1628,7 +1630,7 @@ HttpProjectService::HttpProjectService(CidStore& Store, ProjectStore* Projects) const ProjectStore::Project& Prj = *ProjectIt; CbObjectWriter Response; - Response << "id" << Prj.Identifier << "root" << WideToUtf8(Prj.RootDir.c_str()); + Response << "id" << Prj.Identifier << "root" << ToUtf8(Prj.RootDir); Response.BeginArray("oplogs"sv); Prj.IterateOplogs([&](const ProjectStore::Oplog& I) { Response << "id"sv << I.OplogId(); }); @@ -1654,6 +1656,9 @@ HttpProjectService::HttpProjectService(CidStore& Store, ProjectStore* Projects) return Req.ServerRequest().WriteResponse(HttpResponseCode::NoContent); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost | HttpVerb::kDelete); diff --git a/zenserver/projectstore.h b/zenserver/projectstore.h index c9f49217a..cebe26886 100644 --- a/zenserver/projectstore.h +++ b/zenserver/projectstore.h @@ -97,7 +97,6 @@ public: const std::string& OplogId() const { return m_OplogId; } - const std::wstring& TempDir() const { return m_TempPath.native(); } const std::filesystem::path& TempPath() const { return m_TempPath; } spdlog::logger& Log() { return m_OuterProject->Log(); } diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 55695ac9c..569bf99e0 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -9,17 +9,21 @@ #include <zencore/iobuffer.h> #include <zencore/iohash.h> #include <zencore/logging.h> -#include <zencore/windows.h> -#include <zenstore/CAS.h> - -#include <AccCtrl.h> -#include <AclAPI.h> -#include <sddl.h> - -#include <UserEnv.h> -#pragma comment(lib, "UserEnv.lib") +#include <zenstore/cas.h> + +#if ZEN_PLATFORM_WINDOWS +# include <zencore/windows.h> + +ZEN_THIRD_PARTY_INCLUDES_START +# include <AccCtrl.h> +# include <AclAPI.h> +# include <atlbase.h> +# include <sddl.h> +# include <UserEnv.h> +ZEN_THIRD_PARTY_INCLUDES_END +# pragma comment(lib, "UserEnv.lib") +#endif -#include <atlbase.h> #include <filesystem> #include <span> @@ -27,6 +31,7 @@ using namespace std::literals; namespace zen { +#if ZEN_PLATFORM_WINDOWS struct BasicJob { public: @@ -126,7 +131,19 @@ BasicJob::ExitCode() return gsl::narrow_cast<int>(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; @@ -316,6 +333,10 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath) return true; } +#else +#endif // ZEN_PLATFORM_WINDOWS + +//////////////////////////////////////////////////////////////////////////////// HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::path& SandboxBaseDir) : m_Log(logging::Get("exec")) @@ -336,6 +357,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat case HttpVerb::kPost: break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -362,6 +386,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat Job.SpawnJob("c:\\windows\\system32\\cmd.exe"); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -413,6 +440,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat return HttpReq.WriteResponse(HttpResponseCode::OK, Response); } break; + + default: + break; } }, HttpVerb::kPost); @@ -496,6 +526,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat return HttpReq.WriteResponse(HttpResponseCode::OK, Response.Save()); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp index 168449d05..db1981ec7 100644 --- a/zenserver/upstream/upstreamcache.cpp +++ b/zenserver/upstream/upstreamcache.cpp @@ -185,7 +185,7 @@ namespace detail { if (CacheRecord.Type == ZenContentType::kBinary) { CloudCacheResult Result; - for (int32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) { if (m_UseLegacyDdc) { @@ -211,7 +211,7 @@ namespace detail { for (size_t Idx = 0, Count = Payloads.size(); Idx < Count; Idx++) { Success = false; - for (int32_t Attempt = 0; Attempt < MaxAttempts; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts; Attempt++) { if (CloudCacheResult Result = Session.PutCompressedBlob(CacheRecord.PayloadIds[Idx], Payloads[Idx]); Result.Success) @@ -233,7 +233,7 @@ namespace detail { } Success = false; - for (int32_t Attempt = 0; Attempt < MaxAttempts; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts; Attempt++) { if (PutRefResult Result = Session.PutRef(CacheRecord.CacheKey.Bucket, CacheRecord.CacheKey.Hash, @@ -512,7 +512,7 @@ namespace detail { Package.Save(MemStream); IoBuffer PackagePayload(IoBuffer::Wrap, MemStream.Data(), MemStream.Size()); - for (int32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) { Result = Session.PutCacheRecord(CacheRecord.CacheKey.Bucket, CacheRecord.CacheKey.Hash, @@ -530,7 +530,7 @@ namespace detail { for (size_t Idx = 0, Count = Payloads.size(); Idx < Count; Idx++) { Result.Success = false; - for (int32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) { Result = Session.PutCachePayload(CacheRecord.CacheKey.Bucket, CacheRecord.CacheKey.Hash, @@ -553,7 +553,7 @@ namespace detail { } Result.Success = false; - for (int32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) + for (uint32_t Attempt = 0; Attempt < MaxAttempts && !Result.Success; Attempt++) { Result = Session.PutCacheRecord(CacheRecord.CacheKey.Bucket, CacheRecord.CacheKey.Hash, RecordValue, CacheRecord.Type); diff --git a/zenserver/upstream/zen.h b/zenserver/upstream/zen.h index 12e46bd8d..8e81d1cb6 100644 --- a/zenserver/upstream/zen.h +++ b/zenserver/upstream/zen.h @@ -10,14 +10,14 @@ #include <zencore/uid.h> #include <zencore/zencore.h> -#pragma warning(push) -#pragma warning(disable : 4127) +ZEN_THIRD_PARTY_INCLUDES_START #include <tsl/robin_map.h> -#pragma warning(pop) +ZEN_THIRD_PARTY_INCLUDES_END #include <asio.hpp> #include <chrono> +#include <list> struct ZenCacheValue; diff --git a/zenserver/windows/service.cpp b/zenserver/windows/service.cpp index 23cefb7b5..0eec01698 100644 --- a/zenserver/windows/service.cpp +++ b/zenserver/windows/service.cpp @@ -2,6 +2,8 @@ #include "service.h" +#if ZEN_PLATFORM_WINDOWS + #include <zencore/except.h> #include <zencore/zencore.h> @@ -638,3 +640,5 @@ SvcReportEvent(LPTSTR szFunction) // DeregisterEventSource(hEventSource); //} } + +#endif // ZEN_PLATFORM_WINDOWS diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index 9a8090fc0..f5c38baae 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -12,13 +12,16 @@ #include <zencore/string.h> #include <zencore/thread.h> #include <zencore/timer.h> -#include <zencore/windows.h> #include <zenhttp/httpserver.h> #include <zenstore/basicfile.h> #include <zenstore/cas.h> #include <zenstore/cidstore.h> #include <zenutil/zenserverprocess.h> +#if ZEN_PLATFORM_WINDOWS +# include <zencore/windows.h> +#endif + #if ZEN_USE_MIMALLOC ZEN_THIRD_PARTY_INCLUDES_START # include <mimalloc-new-delete.h> @@ -384,7 +387,7 @@ public: for (auto& PidEntry : m_ServerEntry->SponsorPids) { - if (uint32_t ThisPid = PidEntry.load(std::memory_order::memory_order_relaxed)) + if (uint32_t ThisPid = PidEntry.load(std::memory_order_relaxed)) { if (PidEntry.compare_exchange_strong(ThisPid, 0)) { |