Patch for MinGW-W64 port

Eli Zaretskii eliz at gnu.org
Thu Mar 22 21:26:43 CET 2012


> Date: Thu, 22 Mar 2012 19:43:24 +0100
> From: Nikos Mavrogiannopoulos <nmav at gnutls.org>
> Cc: gnutls-devel at gnu.org
> 
> > -      gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
> > +      gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) ((ptrdiff_t) sd));
> 
> 
> What difference do you see with ptrdiff_t comparing to unsigned long?

64-bit Windows uses the LLP64 model, so `unsigned long' is a 32-bit
type.  By contrast, ptrdiff_t is a (signed) 64-bit type.

> > +    $ac_cv_sizeof_long_long)
> > +      AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long long)],
> > +                [Additional cast to bring void* to a type castable to int.])
> > +      ;;
> 
> 
> Why use long long for pointer to int? Isn't in this platform
> sizeof(void*)==sizeof(long)?

No, see above.  On 64-bit Windows, sizeof(void *) == sizeof(long long)




More information about the Gnutls-devel mailing list