From 9d5e8ed4d2732a09aebfb02a3c6402448ba07a2c Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 15 Sep 2026 13:49:25 -0300 Subject: [PATCH] Fix MSVC deflate compiler errors Signed-off-by: Juan Cruz Viotti --- src/core/gzip/deflate.h | 6 +++--- src/core/gzip/inflate.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/gzip/deflate.h b/src/core/gzip/deflate.h index 509fcb28a8..3fcbc67e1a 100644 --- a/src/core/gzip/deflate.h +++ b/src/core/gzip/deflate.h @@ -89,7 +89,7 @@ class DeflateBitWriter { auto flush() -> void { std::uint64_t word{this->buffer_}; - if (std::endian::native == std::endian::big) { + if constexpr (std::endian::native == std::endian::big) { word = std::byteswap(word); } @@ -542,7 +542,7 @@ class DeflateEncoder { static auto load_32(const std::uint8_t *data) -> std::uint32_t { std::uint32_t word{0}; std::memcpy(&word, data, sizeof(word)); - if (std::endian::native == std::endian::big) { + if constexpr (std::endian::native == std::endian::big) { word = std::byteswap(word); } @@ -552,7 +552,7 @@ class DeflateEncoder { static auto load_64(const std::uint8_t *data) -> std::uint64_t { std::uint64_t word{0}; std::memcpy(&word, data, sizeof(word)); - if (std::endian::native == std::endian::big) { + if constexpr (std::endian::native == std::endian::big) { word = std::byteswap(word); } diff --git a/src/core/gzip/inflate.h b/src/core/gzip/inflate.h index 046a952839..7f4aa589ac 100644 --- a/src/core/gzip/inflate.h +++ b/src/core/gzip/inflate.h @@ -740,7 +740,7 @@ class InflateDecoder { static auto load_word(const std::uint8_t *data) -> std::uint64_t { std::uint64_t word{0}; std::memcpy(&word, data, sizeof(word)); - if (std::endian::native == std::endian::big) { + if constexpr (std::endian::native == std::endian::big) { word = std::byteswap(word); }