From 9cade41dbb9a7b8220d674aba3ff3eb09a410c3b Mon Sep 17 00:00:00 2001 From: tower120 Date: Tue, 21 Apr 2020 08:38:16 +0300 Subject: [PATCH] msvc warnings suppression (#47) --- include/bitsery/details/adapter_common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/bitsery/details/adapter_common.h b/include/bitsery/details/adapter_common.h index e72d68b..de315be 100644 --- a/include/bitsery/details/adapter_common.h +++ b/include/bitsery/details/adapter_common.h @@ -145,11 +145,14 @@ namespace bitsery { /** * endianness utils */ - //add test data in separate struct, because some compilers only support constexpr functions with return-only body + // add test data in separate struct, because some compilers only support constexpr functions with return-only body + // suppress msvc warnings. + #pragma warning( disable : 4310 ) struct EndiannessTestData { static constexpr uint32_t _sample4Bytes = 0x01020304; static constexpr uint8_t _sample1stByte = (const uint8_t &) _sample4Bytes; }; + #pragma warning( default : 4310 ) constexpr EndiannessType getSystemEndianness() { static_assert(EndiannessTestData::_sample1stByte == 0x04 || EndiannessTestData::_sample1stByte == 0x01,