Hi,
  this patch extracts the stdint compat to a compat/xstdint.h header,
and references that from strtoll.c and Tokenizer.cc;

Full farm tested, it introduces no regressions.

-- 
    Francesco
=== modified file 'compat/Makefile.am'
--- compat/Makefile.am	2014-04-21 08:27:21 +0000
+++ compat/Makefile.am	2014-06-02 19:53:56 +0000
@@ -48,6 +48,7 @@
 	xalloc.cc \
 	xalloc.h \
 	xis.h \
+	xstdint.h \
 	xstrerror.cc \
 	xstrerror.h \
 	xstring.cc \

=== modified file 'compat/strtoll.c'
--- compat/strtoll.c	2012-08-28 13:00:30 +0000
+++ compat/strtoll.c	2014-06-02 19:53:56 +0000
@@ -35,6 +35,7 @@
 
 #include "squid.h"
 #include "compat/strtoll.h"
+#include "compat/xstdint.h"
 
 #if HAVE_CTYPE_H
 #include <ctype.h>
@@ -43,26 +44,6 @@
 #include <errno.h>
 #endif
 
-#ifndef INT64_MIN
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MIN) && (SIZEOF_LONG == 8)
-#define INT64_MIN LONG_MIN
-#else
-/* 32 bit system */
-#define INT64_MIN       -9223372036854775807L-1L
-#endif
-#endif
-
-#ifndef INT64_MAX
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MAX) && (SIZEOF_LONG == 8)
-#define INT64_MAX LONG_MAX
-#else
-/* 32 bit system */
-#define INT64_MAX       9223372036854775807L
-#endif
-#endif
-
 /*
  * Convert a string to a int64 integer.
  *

=== added file 'compat/xstdint.h'
--- compat/xstdint.h	1970-01-01 00:00:00 +0000
+++ compat/xstdint.h	2014-06-02 19:59:35 +0000
@@ -0,0 +1,29 @@
+#ifndef SQUID_COMPAT_XSTDINT_H
+#define SQUID_COMPAT_XSTDINT_H
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+
+#ifndef INT64_MIN
+#if defined(LONG_MIN) && (SIZEOF_LONG == 8)
+#define INT64_MIN LONG_MIN
+#else
+/* 32 bit system */
+#define INT64_MIN       -9223372036854775807L-1L
+#endif
+#endif
+
+#ifndef INT64_MAX
+#if defined(LONG_MAX) && (SIZEOF_LONG == 8)
+#define INT64_MAX LONG_MAX
+#else
+/* 32 bit system */
+#define INT64_MAX       9223372036854775807L
+#endif
+#endif
+
+/* add more as needed */
+
+#endif /* SQUID_COMPAT_XSTDINT_H */

=== modified file 'src/parser/Tokenizer.cc'
--- src/parser/Tokenizer.cc	2014-06-02 17:52:31 +0000
+++ src/parser/Tokenizer.cc	2014-06-03 09:48:33 +0000
@@ -1,32 +1,11 @@
 #include "squid.h"
 #include "parser/Tokenizer.h"
+#include "compat/xstdint.h"
 
 #include <cerrno>
 #if HAVE_CTYPE_H
 #include <ctype.h>
 #endif
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifndef INT64_MIN
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MIN) && (SIZEOF_LONG == 8)
-#define INT64_MIN LONG_MIN
-#else
-/* 32 bit system */
-#define INT64_MIN       -9223372036854775807L-1L
-#endif
-#endif
-
-#ifndef INT64_MAX
-/* Native 64 bit system without strtoll() */
-#if defined(LONG_MAX) && (SIZEOF_LONG == 8)
-#define INT64_MAX LONG_MAX
-#else
-/* 32 bit system */
-#define INT64_MAX       9223372036854775807L
-#endif
-#endif
 
 bool
 Parser::Tokenizer::token(SBuf &returnedToken, const CharacterSet &delimiters)

Reply via email to