[or-cvs] Add intptr_t and uintptr_t to torint.h
Nick Mathewson
nickm at seul.org
Wed May 5 20:26:38 UTC 2004
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv12031/src/common
Modified Files:
torint.h
Log Message:
Add intptr_t and uintptr_t to torint.h
Index: torint.h
===================================================================
RCS file: /home/or/cvsroot/src/common/torint.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- torint.h 1 May 2004 20:46:27 -0000 1.7
+++ torint.h 5 May 2004 20:26:35 -0000 1.8
@@ -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 @@
#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"
More information about the tor-commits
mailing list