aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-05-05 20:26:35 +0000
committerNick Mathewson <nickm@torproject.org>2004-05-05 20:26:35 +0000
commit8aebd83a0eb3e6cb312ccbf8e0cbd9b3b48294be (patch)
tree746b74818dc86fc4f393ad586e16b25bc83073c7 /src/common
parente6ac85a8cc75ace50d5b64d324b50aaa112aff03 (diff)
downloadtor-8aebd83a0eb3e6cb312ccbf8e0cbd9b3b48294be.tar.gz
tor-8aebd83a0eb3e6cb312ccbf8e0cbd9b3b48294be.zip
Add intptr_t and uintptr_t to torint.h
svn:r1794
Diffstat (limited to 'src/common')
-rw-r--r--src/common/torint.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index 80ee48820d..ce2d067ab4 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -44,6 +44,12 @@
#if (SIZEOF_UINT64_T != 0)
#define HAVE_UINT64_T
#endif
+#if (SIZEOF_INTPTR_T != 0)
+#define HAVE_INTPTR_T
+#endif
+#if (SIZEOF_UINTPTR_T != 0)
+#define HAVE_UINTPTR_T
+#endif
#if (SIZEOF_CHAR == 1)
#ifndef HAVE_INT8_T
@@ -131,6 +137,23 @@ typedef unsigned __int64 uint64_t;
#endif
#endif
+#if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
+#ifndef HAVE_INTPTR_T
+typedef int64_t intptr_t;
+#endif
+#ifndef HAVE_UINTPTR_T
+typedef uint64_t uintptr_t;
+#endif
+#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4)
+#ifndef HAVE_INTPTR_T
+typedef int32_t intptr_t;
+#endif
+#ifndef HAVE_UINTPTR_T
+typedef uint32_t uintptr_t;
+#endif
+#else
+#error "void * is either >8 bytes or <= 2. In either case, I am confused."
+#endif
#ifndef HAVE_INT8_T
#error "Missing type int8_t"