For some reason, including limits.h on *nix kills the definition of INTMAX_MAX. I'm trying to figure out what is going wrong.
I think it is because our test code is including some headers and not others before mpirxx.h even gets a chance. Bill. On 12 October 2012 21:35, Brian Gladman <[email protected]> wrote: > -----Original Message----- From: leif > Sent: Friday, October 12, 2012 9:32 PM > > To: [email protected] > Subject: Re: [mpir-devel] MPIR 2.6.0 alpha1 released > > Brian Gladman wrote: >> >> -----Original Message----- From: Bill Hart >> Sent: Friday, October 12, 2012 9:15 PM >> To: [email protected] >> 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 <[email protected]> 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 >> >> On Windows the C++ header for LLONG_MAX is <climits> - I am surprised >> that this doesn't exist on *nix. > > > Well, it does (or should). > > ========================= > > So including <climits> in mpirxx.h should not cause problems on *nix? > > Brian > > > -- > You received this message because you are subscribed to the Google Groups > "mpir-devel" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/mpir-devel?hl=en. > -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.
