aboutsummaryrefslogtreecommitdiff
path: root/zenserver
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-16 10:53:54 +0200
committerMartin Ridgers <[email protected]>2021-10-16 10:53:54 +0200
commit8030078d08379d011781c8c09d6840fc24aaec23 (patch)
tree15c5f9b4032140211f34713a034e36ce4b697f78 /zenserver
parentMerged main (diff)
parentFixed up some more windows include issues (diff)
downloadzen-8030078d08379d011781c8c09d6840fc24aaec23.tar.xz
zen-8030078d08379d011781c8c09d6840fc24aaec23.zip
Merged main
Diffstat (limited to 'zenserver')
-rw-r--r--zenserver/cache/structuredcachestore.cpp23
-rw-r--r--zenserver/compute/apply.cpp6
-rw-r--r--zenserver/config.cpp1
-rw-r--r--zenserver/config.h4
-rw-r--r--zenserver/diag/formatters.h7
-rw-r--r--zenserver/diag/logging.cpp5
-rw-r--r--zenserver/experimental/usnjournal.h3
-rw-r--r--zenserver/upstream/jupiter.cpp11
-rw-r--r--zenserver/upstream/zen.cpp11
-rw-r--r--zenserver/zenserver.cpp12
10 files changed, 43 insertions, 40 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 9f63699e5..fcd10bdac 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -725,23 +725,28 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c
DataFile.MoveTemporaryIntoPlace(FsPath, Ec);
- if (Ec)
+ if (!Ec)
{
- std::error_code InnerEc;
- const uint64_t ExistingFileSize = std::filesystem::file_size(FsPath, InnerEc);
+ break;
+ }
- if (!InnerEc && ExistingFileSize == Value.Value.Size())
- {
- // Concurrent write of same value?
- return;
- }
+ std::error_code InnerEc;
+ const uint64_t ExistingFileSize = std::filesystem::file_size(FsPath, InnerEc);
+
+ if (!InnerEc && ExistingFileSize == Value.Value.Size())
+ {
+ // Concurrent write of same value?
+ return;
}
// Semi arbitrary back-off
zen::Sleep(1000 * RetryCount);
} while (RetryCount--);
- throw std::system_error(Ec, "Failed to finalize file '{}'"_format(WideToUtf8(DataFilePath)));
+ if (Ec)
+ {
+ throw std::system_error(Ec, "Failed to finalize file '{}'"_format(WideToUtf8(DataFilePath)));
+ }
}
// Update index
diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp
index a522aa35b..053c262c2 100644
--- a/zenserver/compute/apply.cpp
+++ b/zenserver/compute/apply.cpp
@@ -16,18 +16,16 @@
#include <zenstore/CAS.h>
#include <zenstore/cidstore.h>
-// clang-format off
#if ZEN_PLATFORM_WINDOWS
-# include <zencore/prewindows.h>
+ZEN_THIRD_PARTY_INCLUDES_START
# include <AccCtrl.h>
# include <AclAPI.h>
# include <sddl.h>
# include <UserEnv.h>
# pragma comment(lib, "UserEnv.lib")
# include <atlbase.h>
-# include <zencore/postwindows.h>
+ZEN_THIRD_PARTY_INCLUDES_END
#endif
-// clang-format on
#include <filesystem>
#include <span>
diff --git a/zenserver/config.cpp b/zenserver/config.cpp
index 937598a64..799891289 100644
--- a/zenserver/config.cpp
+++ b/zenserver/config.cpp
@@ -7,6 +7,7 @@
#include <zencore/fmtutils.h>
#include <zencore/iobuffer.h>
#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
diff --git a/zenserver/config.h b/zenserver/config.h
index eaafc31bb..d68549616 100644
--- a/zenserver/config.h
+++ b/zenserver/config.h
@@ -5,6 +5,10 @@
#include <filesystem>
#include <string>
+#ifndef ZEN_ENABLE_MESH
+# define ZEN_ENABLE_MESH 0
+#endif
+
struct ZenServerOptions
{
bool IsDebug = false;
diff --git a/zenserver/diag/formatters.h b/zenserver/diag/formatters.h
index d4eeeb31c..d55765612 100644
--- a/zenserver/diag/formatters.h
+++ b/zenserver/diag/formatters.h
@@ -2,13 +2,10 @@
#pragma once
+ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
-
-#pragma warning(push)
-#pragma warning(disable : 4004)
-#pragma warning(disable : 4996)
#include <cpr/cpr.h>
-#pragma warning(pop)
+ZEN_THIRD_PARTY_INCLUDES_END
template<>
struct fmt::formatter<cpr::Response>
diff --git a/zenserver/diag/logging.cpp b/zenserver/diag/logging.cpp
index 7a7773cba..6e2559f1f 100644
--- a/zenserver/diag/logging.cpp
+++ b/zenserver/diag/logging.cpp
@@ -4,6 +4,7 @@
#include "config.h"
+ZEN_THIRD_PARTY_INCLUDES_START
#include <spdlog/async.h>
#include <spdlog/async_logger.h>
#include <spdlog/pattern_formatter.h>
@@ -13,10 +14,10 @@
#include <spdlog/sinks/msvc_sink.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
-#include <spdlog/spdlog.h>
+ZEN_THIRD_PARTY_INCLUDES_END
+
#include <zencore/string.h>
#include <memory>
-#include "spdlog/sinks/basic_file_sink.h"
// Custom logging -- test code, this should be tweaked
diff --git a/zenserver/experimental/usnjournal.h b/zenserver/experimental/usnjournal.h
index 9c1008d52..688823953 100644
--- a/zenserver/experimental/usnjournal.h
+++ b/zenserver/experimental/usnjournal.h
@@ -2,9 +2,12 @@
#pragma once
+#include <zencore/zencore.h>
#include <zencore/windows.h>
+ZEN_THIRD_PARTY_INCLUDES_START
#include <winioctl.h>
+ZEN_THIRD_PARTY_INCLUDES_END
#include <filesystem>
diff --git a/zenserver/upstream/jupiter.cpp b/zenserver/upstream/jupiter.cpp
index 1c43f1bc6..556a2124d 100644
--- a/zenserver/upstream/jupiter.cpp
+++ b/zenserver/upstream/jupiter.cpp
@@ -6,21 +6,16 @@
#include "diag/formatters.h"
#include "diag/logging.h"
-#include <fmt/format.h>
#include <zencore/compactbinary.h>
#include <zencore/iobuffer.h>
#include <zencore/iohash.h>
#include <zencore/string.h>
#include <zencore/thread.h>
-// For some reason, these don't seem to stick, so we disable the warnings
-//# define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING 1
-//# define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS 1
-#pragma warning(push)
-#pragma warning(disable : 4004)
-#pragma warning(disable : 4996)
+ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
-#pragma warning(pop)
+#include <fmt/format.h>
+ZEN_THIRD_PARTY_INCLUDES_END
#if ZEN_PLATFORM_WINDOWS
# pragma comment(lib, "Crypt32.lib")
diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp
index 6141fd397..14333f45a 100644
--- a/zenserver/upstream/zen.cpp
+++ b/zenserver/upstream/zen.cpp
@@ -12,16 +12,9 @@
#include "diag/formatters.h"
#include "diag/logging.h"
-// cpr ////////////////////////////////////////////////////////////////////
-//
-// For some reason, these don't seem to stick, so we disable the warnings
-//# define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING 1
-//# define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS 1
-#pragma warning(push)
-#pragma warning(disable : 4004)
-#pragma warning(disable : 4996)
+ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
-#pragma warning(pop)
+ZEN_THIRD_PARTY_INCLUDES_END
#include <xxhash.h>
#include <gsl/gsl-lite.hpp>
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index a1cd01d33..c9b52604d 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -16,17 +16,21 @@
#include <zenstore/cidstore.h>
#include <zenutil/zenserverprocess.h>
-#include <fmt/format.h>
-
#if ZEN_USE_MIMALLOC
+ZEN_THIRD_PARTY_INCLUDES_START
# include <mimalloc-new-delete.h>
# include <mimalloc.h>
+ZEN_THIRD_PARTY_INCLUDES_END
#endif
+ZEN_THIRD_PARTY_INCLUDES_START
+#include <fmt/format.h>
#include <asio.hpp>
+#include <lua.hpp>
+ZEN_THIRD_PARTY_INCLUDES_END
+
#include <exception>
#include <list>
-#include <lua.hpp>
#include <optional>
#include <regex>
#include <set>
@@ -64,7 +68,9 @@
#if USE_SENTRY
# define SENTRY_BUILD_STATIC 1
+ZEN_THIRD_PARTY_INCLUDES_START
# include <sentry.h>
+ZEN_THIRD_PARTY_INCLUDES_END
// Sentry currently does not automatically add all required Windows
// libraries to the linker when consumed via vcpkg