From 706422661a2b6b5370dc42be2b7e39bfee37a27c Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:48:49 +0300 Subject: [PATCH] wrap proto includes to avoid build warnings --- dll/dll/common_includes.h | 2 +- dll/dll/include.wrap.net.pb.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 dll/dll/include.wrap.net.pb.h diff --git a/dll/dll/common_includes.h b/dll/dll/common_includes.h index 35120ec2..17a398c4 100644 --- a/dll/dll/common_includes.h +++ b/dll/dll/common_includes.h @@ -237,7 +237,7 @@ static inline void reset_LastError() // Emulator includes // add them here after the inline functions definitions -#include "net.pb.h" +#include "include.wrap.net.pb.h" #include "settings.h" #include "local_storage.h" #include "network.h" diff --git a/dll/dll/include.wrap.net.pb.h b/dll/dll/include.wrap.net.pb.h new file mode 100644 index 00000000..66501606 --- /dev/null +++ b/dll/dll/include.wrap.net.pb.h @@ -0,0 +1,14 @@ + +#if defined(__linux__) || defined(linux) || defined(GNUC) || defined(__MINGW32__) || defined(__MINGW64__) + // https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html + // https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wall + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wall" + #include "net.pb.h" + #pragma GCC diagnostic pop +#else + // https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170#push-and-pop + #pragma warning(push, 0) + #include "net.pb.h" + #pragma warning(pop) +#endif