In mpir.h (and gmp-h.in from which it is generated unless I miss my guess), 
starting at line 66, the following code can be found:

/*  #if defined(__GMP_WITHIN_CONFIGURE) && defined(_WIN64)   */
#ifdef __WIN64
#define _LONG_LONG_LIMB 1
#endif

In my humble opinion its intent is to deal with the fact that long is a 32 bit 
value when using MSVC to compile for AMD64 targets by defining _LONG_LONG_LIMB, 
which in turn will cause long long to be used instead.

However, at least when using MingW64 to compile to a Windows DLL, the output 
header mpir.h contains the same lines. MSVC does not define __WIN64 (it does 
define _WIN64 instead -- note the number of underbars) and therefore will 
assume that _LONG_LONG_LIMB is *not* defined.

As a result, when using the DLL from MSVC, it will assume that e.g. mpir_ui is 
unsigned long - which works surprisingly well for being completely wrong.

As a simple fix, the following works for me:
#if defined(__WIN64) || defined(_WIN64)
#define _LONG_LONG_LIMB 1
#endif

Hopefully this suggestion is somewhat helpful and not just wasting your time ;)

-- 
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