[MLton] Re: GMP patch: MinGW/win64 port

Ville Laurikari ville at laurikari.net
Tue Mar 4 10:01:51 PST 2008


On Tue, Mar 04, 2008 at 04:23:55PM +0100, Torbjorn Granlund wrote:
>   long long x = 34324;
>   printf("blah: %"PRIdMAX"\n", (uintmax_t)x);
>
>   AFAIK, this should be portable to all systems (including mingw/win64).
>
> I strongly doubt it to be portable in the sense we need for GMP.

I don't know much about GMP code, but wouldn't it make sense to use
these C99 features?  If a platform does not have them defined, you can
define them yourself to something suitable with an Autoconf script or something.

On Windows, PRIdMAX needs to be "I64d" (mingw inttypes.h does this,
Microsoft headers probably don't).  With msvc, uintmax_t would be
`unsigned __int64', and with gcc it would be `unsigned long long'.

--
http://www.iki.fi/vl/



More information about the MLton mailing list