On 15/10/2014 11:25, sisyph...@optusnet.com.au wrote:
> -----Original Message----- From: Brian Gladman
> 
>> The original poster is trying to use a mingw64 produced DLL to build an
>> application with the Microsoft compiler so he will NOT get the mpir.h
>> file that is specifically designed for use with the MS compiler but
>> whatever mingw64 produces.
> 
> Aaah, that makes things a little clearer to me. (I hadn't grasped that
> from the OP's post.)
> 
>> Since it appears that __WIN64 is defined by mingw64, it will use long
>> long limbs for mpir_ui and mpir_si but when this same mpir.h is used by
>> MSVC it will presumably see these defined as longs.
> 
> Hmm ... I was thinking that whenever an mpir_ui gets passed to the DLL,
> it will only ever be a 32-bit value. But that won't bother the DLL
> because a long long accurately handles 32-bit values (on little endian
> machines, at least).
> But if the DLL also passes back 64-bit values, and those values are
> getting truncated to 32 bits then, yes, that wouldn't be pretty ;-)
> 
>> In any event, the full section that gets added to mpir.h during an MSVC
>> build is:
>>
>> #if ! defined (__GMP_WITHIN_CONFIGURE)
>> #ifdef _WIN32
>> #  ifdef _WIN64
>> #    define _LONG_LONG_LIMB  1
>> #    define GMP_LIMB_BITS   64
>> #  else
>> #    define GMP_LIMB_BITS   32
>> #  endif
>> #  define __GMP_BITS_PER_MP_LIMB  GMP_LIMB_BITS
>> #  define SIZEOF_MP_LIMB_T (GMP_LIMB_BITS >> 3)
>> #  define GMP_NAIL_BITS                       0
>> #endif
>> #endif
> 
> Could that be built into mpir.h (inside an '#ifdef _MSC_VER' block) ?
> If that's possible, then it would seem a good solution for these
> "hybrid" situations.

Hi Rob,

It could be but the MSVC build works in the way that configure does on
other systems in that it takes gmp_h.in and spits out an appropriate
header for MSVC.  The MSVC build process has used this appraoch for a
very long time and it is now very stable and mature.  Moving this
addition into gmp_h.in would involve a significant rework of the MSVC
build and I really can't see this as a useful exercise.

In my view, those who need such hybrid build capabilities should (a)
explain why they can't use MSVC to build MPIR, and (b) put in the effort
to support such builds if they really need them.

  best regards,

    Brian

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to