summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/include/limits.h10
-rw-r--r--winsup/cygwin/release/2.5.33
2 files changed, 12 insertions, 1 deletions
diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h
index 2083e3e64..cf3c8d04d 100644
--- a/winsup/cygwin/include/limits.h
+++ b/winsup/cygwin/include/limits.h
@@ -128,9 +128,17 @@ details. */
#undef ULLONG_MAX
#define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
-/* Maximum size of ssize_t */
+/* Maximum size of ssize_t. Sadly, gcc doesn't give us __SSIZE_MAX__
+ the way it does for __SIZE_MAX__. On the other hand, we happen to
+ know that for Cygwin, ssize_t is 'int' on 32-bit and 'long' on
+ 64-bit, and this particular header is specific to Cygwin, so we
+ don't have to jump through hoops. */
#undef SSIZE_MAX
+#if __WORDSIZE == 64
#define SSIZE_MAX (__LONG_MAX__)
+#else
+#define SSIZE_MAX (__INT_MAX__)
+#endif
/* Runtime Invariant Values */
diff --git a/winsup/cygwin/release/2.5.3 b/winsup/cygwin/release/2.5.3
index a27106bff..0a273964a 100644
--- a/winsup/cygwin/release/2.5.3
+++ b/winsup/cygwin/release/2.5.3
@@ -10,6 +10,9 @@ What changed:
- Raise number of supported partitions per disk (for raw access) to 63.
Addresses: https://cygwin.com/ml/cygwin/2016-06/msg00136.html
+- Fix definition of SSIZE_MAX on 32-bit systems.
+ Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00179.html
+
Bug Fixes
---------