gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for MinGW-W64 port


From: B. Scott Michel
Subject: Re: Patch for MinGW-W64 port
Date: Thu, 22 Mar 2012 16:34:43 -0800
User-agent: Roundcube Webmail/0.7.1

On 22.03.2012 12:26, Eli Zaretskii wrote:

Date: Thu, 22 Mar 2012 19:43:24 +0100 From: Nikos Mavrogiannopoulos <address@hidden> Cc: address@hidden
- 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)

Yes, what Eli said... By definition, ptrdiff_t is the difference between two pointers, which is preferred if one is going to do pointer arithmetic, irrespective of platform word size. Hence, one benefit of the patch is increased portability, if not standards conformance.

-scooter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]