From: Alex Rousskov Date: Mon, 16 Jun 2014 22:45:23 +0000 (-0600) Subject: Fix build on some 32bit systems with strtoll() X-Git-Tag: SQUID_3_5_0_1~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=880d2ea6b0ad3d7cdb4589bb608fb0ff922d979c;p=thirdparty%2Fsquid.git Fix build on some 32bit systems with strtoll() broken by r13429 that duplicated unportable portability code. GCC exits with errors: integer constant is too large for 'long' type nnnL constants are "long" and cannot hold 64bit integers on 32bit platforms. Use LL suffix for 64bit constants for now. It remains to be seen how portable that LL C++ extension is: https://gcc.gnu.org/onlinedocs/gcc/Long-Long.html Also fixed INT64_MIN #define (missing parenthesis). --- diff --git a/compat/strtoll.c b/compat/strtoll.c index ab8ecf1d74..15a6e36a7c 100644 --- a/compat/strtoll.c +++ b/compat/strtoll.c @@ -49,7 +49,7 @@ #define INT64_MIN LONG_MIN #else /* 32 bit system */ -#define INT64_MIN -9223372036854775807L-1L +#define INT64_MIN (-9223372036854775807LL-1LL) #endif #endif @@ -59,7 +59,7 @@ #define INT64_MAX LONG_MAX #else /* 32 bit system */ -#define INT64_MAX 9223372036854775807L +#define INT64_MAX 9223372036854775807LL #endif #endif diff --git a/src/parser/Tokenizer.cc b/src/parser/Tokenizer.cc index 8b3be8d85f..ecb2729631 100644 --- a/src/parser/Tokenizer.cc +++ b/src/parser/Tokenizer.cc @@ -14,7 +14,7 @@ #define INT64_MIN LONG_MIN #else /* 32 bit system */ -#define INT64_MIN -9223372036854775807L-1L +#define INT64_MIN (-9223372036854775807LL-1LL) #endif #endif @@ -24,7 +24,7 @@ #define INT64_MAX LONG_MAX #else /* 32 bit system */ -#define INT64_MAX 9223372036854775807L +#define INT64_MAX 9223372036854775807LL #endif #endif