aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-22 03:26:35 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-22 03:26:35 +0000
commit031c21277637f6a9c287b5118348d82a966d5fee (patch)
treeeab64dde83b96b86ee862c297b13d2f02239b157 /src/common/torint.h
parent688b7ddf83ce7cfbcd0af9d55b802259b64c0337 (diff)
downloadtor-031c21277637f6a9c287b5118348d82a966d5fee.tar
tor-031c21277637f6a9c287b5118348d82a966d5fee.tar.gz
r18360@catbus: nickm | 2008-02-21 22:26:32 -0500
Make torint.h define ssize_t more robustly; add spaces to last patch svn:r13670
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index e6f3180e9..6f515495d 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -42,11 +42,6 @@
#include <inttypes.h>
#endif
-#ifdef MS_WINDOWS
-/* Windows likes to capitalize ssize_t. Charming. */
-#define ssize_t SSIZE_T
-#endif
-
#if (SIZEOF_INT8_T != 0)
#define HAVE_INT8_T
#endif
@@ -186,6 +181,16 @@ typedef unsigned __int64 uint64_t;
#endif
#endif
+#ifndef HAVE_SSIZE_T
+#if SIZEOF_SIZE_T == 8
+typedef int64_t ssize_t;
+#elif SIZEOF_SIZE_T == 4
+typedef int32_t ssize_t;
+#else
+#error "Can't define ssize_t."
+#endif
+#endif
+
#if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
#ifndef HAVE_INTPTR_T
typedef int64_t intptr_t;