aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-05 17:54:50 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-05 17:54:50 +0000
commit38ed0ce5e6a34276ccbe6b583cb7006eed263be9 (patch)
treeba2c0e3d8b2872e79651a9c43fe9b9d435e2c21d /src/common/torint.h
parent0c583a6cf295f6de3154a45ae17113b2b9506473 (diff)
downloadtor-38ed0ce5e6a34276ccbe6b583cb7006eed263be9.tar
tor-38ed0ce5e6a34276ccbe6b583cb7006eed263be9.tar.gz
Unify tor_parse_(numeric); make sure MAX_UINT32 and MAX_UINT64 are defined
svn:r2688
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index 8018fd889..aec8d686e 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -106,6 +106,9 @@ typedef signed int int32_t;
typedef unsigned int uint32_t;
#define HAVE_UINT32_T
#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX 0xffffffffu
+#endif
#endif
@@ -117,6 +120,9 @@ typedef signed long int32_t;
#ifndef HAVE_UINT32_T
typedef unsigned long uint32_t;
#define HAVE_UINT32_T
+#ifndef UINT32_MAX
+#define UINT32_MAX 0xfffffffful
+#endif
#endif
#elif (SIZEOF_LONG == 8)
#ifndef HAVE_INT64_T
@@ -127,6 +133,9 @@ typedef signed long int64_t;
typedef unsigned long uint64_t;
#define HAVE_UINT32_T
#endif
+#ifndef UINT64_MAX
+#define UINT64_MAX 0xfffffffffffffffful
+#endif
#endif
#if (SIZEOF_LONG_LONG == 8)
@@ -138,6 +147,9 @@ typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define HAVE_UINT64_T
#endif
+#ifndef UINT64_MAX
+#define UINT64_MAX 0xffffffffffffffffull
+#endif
#endif
#if (SIZEOF___INT64 == 8)
@@ -149,6 +161,9 @@ typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define HAVE_UINT64_T
#endif
+#ifndef UINT64_MAX
+#define UINT64_MAX 0xffffffffffffffffui64
+#endif
#endif
#if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)