From 8522d50f14ff607292c50b616893591788189e5b Mon Sep 17 00:00:00 2001 From: "wendt.peter" Date: Wed, 15 Sep 2021 09:17:23 +0200 Subject: [PATCH] Add support for mingw and fix signedness compare warning --- kaitai/kaitaistream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kaitai/kaitaistream.cpp b/kaitai/kaitaistream.cpp index 32e757a..085d894 100644 --- a/kaitai/kaitaistream.cpp +++ b/kaitai/kaitaistream.cpp @@ -9,7 +9,7 @@ #define __BYTE_ORDER BYTE_ORDER #define __BIG_ENDIAN BIG_ENDIAN #define __LITTLE_ENDIAN LITTLE_ENDIAN -#elif defined(_MSC_VER) // !__APPLE__ +#elif defined(_MSC_VER) || defined(__MINGW32__)// !__APPLE__ #include #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 @@ -572,7 +572,7 @@ std::string kaitai::kstream::to_string(int val) { // if int is 64 bits, "-9223372036854775808" is the longest // => 20 chars + zero => 21 chars char buf[25]; - int got_len = snprintf(buf, sizeof(buf), "%d", val); + size_t got_len = snprintf(buf, sizeof(buf), "%d", val); // should never happen, but check nonetheless if (got_len > sizeof(buf))