On 12 October 2012 21:22, Brian Gladman <b...@gladman.plus.com> wrote:
> -----Original Message----- From: Bill Hart
> Sent: Friday, October 12, 2012 9:15 PM
>
> To: mpir-devel@googlegroups.com
> Subject: Re: [mpir-devel] MPIR 2.6.0 alpha1 released
>
> I believe these only get defined if you first define some macro.
>
> On 12 October 2012 21:13, leif <not.rea...@online.de> wrote:
>>
>> Bill Hart wrote:
>>>
>>>
>>> Another problem is in the test functions for the ux/sx functions, we
>>> use %lld in the format specifier for an intmax_t. This is only valid
>>> if intmax_t is actually a long long int, which it is not on some *nix
>>> platforms (ia64 for example).
>>>
>>> C99 introduced a new format specifier (which I forgot already) for
>>> intmax_t. Of course this is only supported by C99 compilers. I hope
>>> MSVC is C99 compliant enough to have gotten this right, otherwise we
>>> have a lot of fiddling around to do.
>>
>>
>>
>> It doesn't really specify new format letters AFAIK, but inttypes.h, which
>> defines macros for (portably) printing and scanning the types defined in
>> stdint.h, e.g. PRIu64 and SCNu64, regardless of whether uint64_t expands
>> to
>> 'unsigned long' ("%lu") or 'unsigned long long' ("%llu"); one can for
>> example use
>>
>>   printf("%20"PRIu64"\n", (uint64_t)foo); // mind the % and quoting
>>
>>
>> For printing [u]intmax_t, the macros are PRIdMAX, PRIiMAX, PRIoMAX
>> (octal),
>> PRIuMAX, PRIxMAX and PRIXMAX (hexadecimal, lower and upper case,
>> respectively).
>>
>>
>> -leif
>
>
> However, inttypes.h is not available on Windows.
>
> Going back to stdint.h, I think the assumption is that this needs to be
> included by the user before the mpirxx.h include so we should not include it
> in mpirxx.h
>

But we can't do this on systems which don't support stdint.h. This was
not part of the standard before C99. Some systems before C99 partially
implement it, e.g. MSVC.

> On Windows the C++ header for LLONG_MAX is <climits> - I am surprised that
> this doesn't exist on *nix.
>

It exists, but is only partially implemented before c++0x compliant gcc.

Bill.

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to