This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH 64bit] ssize_t
On Feb 20 03:23, Yaakov (Cygwin/X) wrote:
> I just discovered an issue resulting from this commit:
> 2002-06-27 Jeff Johnston <jjohnstn@...>
> * libc/include/sys/_types.h: Define _ssize_t as int if int is
> 32-bits, otherwise define it as long.
> On x86_64-cygwin (as on Linux), int is still 32 bits, but size_t is a
> 64bit unsigned long and ssize_t should be as large but signed.
> Possible patch for newlib attached; corresponding patches for
> cygwin-64bit-branch on cygwin-patches@.
Thanks for the patch. I'm just wondering if ssize_t shouldn't ideally
be based on size_t, at least when using GCC. GCC has a predefined
What I'm thinking of is something like
# ifdef __SIZEOF_SIZE_T__
# if defined (__SIZEOF_INT__) && __SIZEOF_SIZE_T__ == __SIZEOF_INT__
typedef int ssize_t;
typedef long ssize_t
# elif defined(__INT_MAX__) && defined(__LONG_MAX__) && __LONG_MAX__ == __INT_MAX__
typedef int _ssize_t;
typedef long _ssize_t;
Does that make sense?