]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build on some 32bit systems with strtoll()
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 16 Jun 2014 22:45:23 +0000 (16:45 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 16 Jun 2014 22:45:23 +0000 (16:45 -0600)
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).

compat/strtoll.c
src/parser/Tokenizer.cc

index ab8ecf1d7496b868cd61a33624b318767fc74d35..15a6e36a7c497638c1779f47206a340096ecd47e 100644 (file)
@@ -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
 
index 8b3be8d85f6fe1c00baabbf80cfed06065496984..ecb27296314b7869e2b7e2577767ad0adb01f26b 100644 (file)
@@ -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