[PATCH] Fix 32-bit SSIZE_MAX
Thu Jul 14 18:50:00 GMT 2016
On Jul 14 12:39, Eric Blake wrote:
> On 07/14/2016 09:09 AM, Corinna Vinschen wrote:
> > On Jul 13 15:02, Eric Blake wrote:
> >> POSIX requires that SSIZE_MAX have the same type as ssize_t, but
> >> on 32-bit, we were defining it as a long even though ssize_t
> >> resolves to an int. It also requires that SSIZE_MAX be usable
> >> via preprocessor #if, so we can't cheat and use a cast.
> >> If this were newlib, I'd have had to hack _intsup.h to probe the
> >> qualities of size_t (via gcc's __SIZE_TYPE__), similar to how we
> >> already probe the qualities of int8_t and friends, then cross our
> >> fingers that ssize_t happens to have the same rank (most systems
> >> do, but POSIX permits a system where they differ such as size_t
> >> being long while ssize_t is int). Unfortunately gcc gives us
> >> neither __SSIZE_TYPE__ nor __SSIZE_MAX__. On the other hand, our
> >> limits.h is specific to cygwin, we can just shortcut to the
> >> correct results rather than being generic to all possible ABI.
> >> Signed-off-by: Eric Blake <email@example.com>
> >> ---
> >> winsup/cygwin/include/limits.h | 10 +++++++++-
> > Looks good, please apply.
> And I remembered to update the release notes, too.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available
More information about the Cygwin-patches