diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-02-01 22:29:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-07-18 09:51:30 +0100 |
commit | 18afed0f98d020608c65293ecb9246dab6c58db3 (patch) | |
tree | 376aa1289f3f0e934e8381507c337d68e1e4b89a /libbb | |
parent | d416bdac2fff5eed7cfa70499ff61c8b8a9ca7ce (diff) | |
download | busybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.tar.gz busybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.tar.bz2 busybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.zip |
Use %I64* formats with MinGW instead of %ll* formats
The MSVC runtime uses the format specified %I64 for 64-bit data types;
It does not understand e.g. %llu for unsigned long longs.
However, mingw-w64 provides a compatibility mode in its runtime wrapper
which can be activated by defining the constant __USE_MINGW_ANSI_STDIO=1
in which case we must refrain from overriding the %ll* formats.
This fixes quite a couple of compile warnings when building with the
mingw-w64 compiler.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xatonum_template.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c index e0471983c..0d5d35b47 100644 --- a/libbb/xatonum_template.c +++ b/libbb/xatonum_template.c | |||
@@ -67,7 +67,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base, | |||
67 | if (r >= lower && r <= upper) | 67 | if (r >= lower && r <= upper) |
68 | return r; | 68 | return r; |
69 | range: | 69 | range: |
70 | bb_error_msg_and_die("number %s is not in %llu..%llu range", | 70 | bb_error_msg_and_die("number %s is not in %"LL_FMT"u..%"LL_FMT"u range", |
71 | numstr, (unsigned long long)lower, | 71 | numstr, (unsigned long long)lower, |
72 | (unsigned long long)upper); | 72 | (unsigned long long)upper); |
73 | inval: | 73 | inval: |
@@ -144,7 +144,8 @@ type FAST_FUNC xstrto(_range_sfx)(const char *numstr, int base, | |||
144 | } | 144 | } |
145 | 145 | ||
146 | if (r < lower || r > upper) { | 146 | if (r < lower || r > upper) { |
147 | bb_error_msg_and_die("number %s is not in %lld..%lld range", | 147 | bb_error_msg_and_die("number %s is not in " |
148 | "%"LL_FMT"d..%"LL_FMT"d range", | ||
148 | numstr, (long long)lower, (long long)upper); | 149 | numstr, (long long)lower, (long long)upper); |
149 | } | 150 | } |
150 | 151 | ||