diff options
| author | Stefan Boberg <[email protected]> | 2021-10-15 16:29:38 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-15 16:29:38 +0200 |
| commit | bb258b7bf62c5021d2ccde38107efcfdfc52ddd0 (patch) | |
| tree | 6d641ac4ecc04373e19a9c80776a47ba5b590eaf /zenserver | |
| parent | zencore: added ZEN_THIRD_PARTY_INCLUDES_START/ZEN_THIRD_PARTY_INCLUDES_END (diff) | |
| download | zen-bb258b7bf62c5021d2ccde38107efcfdfc52ddd0.tar.xz zen-bb258b7bf62c5021d2ccde38107efcfdfc52ddd0.zip | |
zencore: Enabled MSC warning 4668 to get warnings when preprocessor macros are used without an explicit definition
Also fixed up various code to compile with this, by using ZEN_THIRD_PARTY_INCLUDES_START/ZEN_THIRD_PARTY_INCLUDES_END macros
Removed prewindows.h/postwindows.h since they are no longer to be used due to the above
Diffstat (limited to 'zenserver')
| -rw-r--r-- | zenserver/compute/apply.cpp | 6 | ||||
| -rw-r--r-- | zenserver/config.cpp | 1 | ||||
| -rw-r--r-- | zenserver/config.h | 4 | ||||
| -rw-r--r-- | zenserver/diag/formatters.h | 7 | ||||
| -rw-r--r-- | zenserver/diag/logging.cpp | 5 | ||||
| -rw-r--r-- | zenserver/experimental/usnjournal.h | 3 | ||||
| -rw-r--r-- | zenserver/upstream/jupiter.cpp | 11 | ||||
| -rw-r--r-- | zenserver/upstream/zen.cpp | 11 | ||||
| -rw-r--r-- | zenserver/zenserver.cpp | 12 |
9 files changed, 29 insertions, 31 deletions
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 8d7254ae1..cbdbebb03 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 |