summaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-08-11 20:50:30 +0000
committerNick Mathewson <nickm@torproject.org>2003-08-11 20:50:30 +0000
commit7284c25b3460790c3c0b61366c1b4350fc953746 (patch)
tree7d6c9abc112225fdcf16fb05a140ee4c41484ca3 /src/common/torint.h
parent52675184552c7284d4b4eb9a55f098cc80319f85 (diff)
downloadtor-7284c25b3460790c3c0b61366c1b4350fc953746.tar.gz
tor-7284c25b3460790c3c0b61366c1b4350fc953746.zip
Cope better on platforms that define some of intFOO_t in sys/types.h or elsewhere
svn:r377
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index 65984b5190..4ab7e62ed0 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -7,15 +7,20 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
-#else
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#ifndef HAVE_INT8_T
#if (SIZEOF_CHAR == 1)
typedef unsigned char uint8_t;
typedef signed char int8_t;
#else
#error "sizeof(char) != 1"
#endif
+#endif
+#ifndef HAVE_INT16_T
#if (SIZEOF_SHORT == 2)
typedef unsigned short uint16_t;
typedef signed short int16_t;
@@ -25,7 +30,9 @@ typedef signed int int16_t;
#else
#error "sizeof(short) != 2 && sizeof(int) != 2"
#endif
+#endif
+#ifndef HAVE_INT32_T
#if (SIZEOF_INT == 4)
typedef unsigned int uint32_t;
typedef signed int int32_t;
@@ -35,7 +42,9 @@ typedef signed long int32_t;
#else
#error "sizeof(int) != 4 && sizeof(long) != 4"
#endif
+#endif
+#ifndef HAVE_INT64_T
#if (SIZEOF_LONG == 8)
typedef unsigned long uint64_t;
typedef signed long int64_t;
@@ -48,6 +57,7 @@ typedef signed __int64 int64_t;
#else
#error "sizeof(long) != 8 && sizeof(long long) != 8 && sizeof(__int64) != 8"
#endif
+#endif
#endif /* HAVE_STDINT_H */