From 5126f203f23773f64b51e5c0c7b7e1d702f26ca9 Mon Sep 17 00:00:00 2001
From: Nick Mathewson <nickm@torproject.org>
Date: Mon, 11 Aug 2003 23:21:51 +0000
Subject: [PATCH] Work on systems with broken AC_CHECK_TYPE

svn:r379
---
 configure.in        | 11 ++++++++++-
 src/common/torint.h | 25 +++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index cf5ab525e0..1c28867526 100644
--- a/configure.in
+++ b/configure.in
@@ -142,7 +142,16 @@ AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h)
 dnl In case we aren't given a working stdint.h, we'll need to grow our own.
 dnl Watch out.
 
-AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t])
+AC_CHECK_SIZEOF(int8_t)
+AC_CHECK_SIZEOF(int16_t)
+AC_CHECK_SIZEOF(int32_t)
+AC_CHECK_SIZEOF(int64_t)
+AC_CHECK_SIZEOF(uint8_t)
+AC_CHECK_SIZEOF(uint16_t)
+AC_CHECK_SIZEOF(uint32_t)
+AC_CHECK_SIZEOF(uint64_t)
+
+dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t])
 
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
diff --git a/src/common/torint.h b/src/common/torint.h
index 75032d8f65..96b1e83335 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -15,6 +15,31 @@
 #endif
 
 
+#if (SIZEOF_INT8_T != 0)
+#define HAVE_INT8_T
+#endif
+#if (SIZEOF_INT16_T != 0)
+#define HAVE_INT16_T
+#endif
+#if (SIZEOF_INT32_T != 0)
+#define HAVE_INT32_T
+#endif
+#if (SIZEOF_INT64_T != 0)
+#define HAVE_INT64_T
+#endif
+#if (SIZEOF_UINT8_T != 0)
+#define HAVE_UINT8_T
+#endif
+#if (SIZEOF_UINT16_T != 0)
+#define HAVE_UINT16_T
+#endif
+#if (SIZEOF_UINT32_T != 0)
+#define HAVE_UINT32_T
+#endif
+#if (SIZEOF_UINT64_T != 0)
+#define HAVE_UINT64_T
+#endif
+
 #if (SIZEOF_CHAR == 1)
 #ifndef HAVE_INT8_T
 typedef signed char int8_t;
-- 
GitLab