aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-11-05 19:29:17 +0000
committerNick Mathewson <nickm@torproject.org>2008-11-05 19:29:17 +0000
commit35bef7fefd6e8fabf759da7c54d8003210661896 (patch)
treedff4684b0a630849c27a36dd33b847923baddc85 /src/common/torint.h
parentad6971d3b372ef2fd0727a0665ea29fd9c6862e0 (diff)
downloadtor-35bef7fefd6e8fabf759da7c54d8003210661896.tar.gz
tor-35bef7fefd6e8fabf759da7c54d8003210661896.zip
make read_all and write_all return ssize_t.
svn:r17194
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index 6f515495d1..9004773221 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -316,6 +316,16 @@ typedef uint32_t uintptr_t;
#endif
#endif
+#ifndef SSIZE_T_MAX
+#if (SIZEOF_SIZE_T == 4)
+#define SSIZE_T_MAX INT32_MAX
+#elif (SIZEOF_SIZE_T == 8)
+#define SSIZE_T_MAX INT64_MAX
+#else
+#error "Can't define SSIZE_T_MAX"
+#endif
+#endif
+
/* Any size_t larger than this amount is likely to be an underflow. */
#define SIZE_T_CEILING (sizeof(char)<<(sizeof(size_t)*8 - 1))