[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Cope better on platforms that define some of intFOO_t in sy...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Cope better on platforms that define some of intFOO_t in sy...
- From: nickm@seul.org (Nick Mathewson)
- Date: Mon, 11 Aug 2003 16:50:32 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 11 Aug 2003 16:50:46 -0400
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv26407/src/common
Modified Files:
torint.h
Log Message:
Cope better on platforms that define some of intFOO_t in sys/types.h or elsewhere
Index: torint.h
===================================================================
RCS file: /home/or/cvsroot/src/common/torint.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- torint.h 11 Aug 2003 20:40:21 -0000 1.1
+++ torint.h 11 Aug 2003 20:50:30 -0000 1.2
@@ -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 @@
#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 @@
#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;
@@ -47,6 +56,7 @@
typedef signed __int64 int64_t;
#else
#error "sizeof(long) != 8 && sizeof(long long) != 8 && sizeof(__int64) != 8"
+#endif
#endif
#endif /* HAVE_STDINT_H */