Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mingw and fix signedness compare warning #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add support for mingw and fix signedness compare warning
  • Loading branch information
wendt.peter committed Sep 15, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8522d50f14ff607292c50b616893591788189e5b
4 changes: 2 additions & 2 deletions kaitai/kaitaistream.cpp
Original file line number Diff line number Diff line change
@@ -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 <stdlib.h>
#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))