[PATCH] Fix off_t typedef on Cygwin64

Corinna Vinschen vinschen@redhat.com
Tue Aug 30 09:43:00 GMT 2016


On Aug 29 15:41, Yaakov Selkowitz wrote:
> While both long and long long are 64-bits on x86_64, they are distinct types,
> and long was used prior to commit 477463a2011ba81907a753df9ce7a71b6563db54.
> Changing this breaks the linking of previously compiled C++ functions with
> off_t arguments on 64-bit Cygwin with newly compiled code, as the mangling of
> long (l) and long long (x) differ.

Uh oh.

> 
> Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
> ---
>  newlib/libc/include/sys/_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
> index 4bf2bc4..98b93ce 100644
> --- a/newlib/libc/include/sys/_types.h
> +++ b/newlib/libc/include/sys/_types.h
> @@ -94,7 +94,7 @@ typedef __uint32_t __mode_t;
>  __extension__ typedef long long _off64_t;
>  #endif
>  
> -#ifdef __CYGWIN__
> +#if defined(__CYGWIN__) && !defined(__LP64__)
>  typedef _off64_t __off_t;
>  #else
>  typedef _off_t __off_t;
> -- 
> 2.8.3

The original code used #if __WORDSIZE == 64 but I guess it dosn't
matter.  Please apply with whatever seems most feasible.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160830/f3bbec1d/attachment.sig>


More information about the Newlib mailing list