This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: PATCH: Use __LONG_LONG_MAX__ if LONG_LONG_MIN etc are not available
- To: rittle at labs dot mot dot com
- Subject: Re: PATCH: Use __LONG_LONG_MAX__ if LONG_LONG_MIN etc are not available
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 31 Jul 2001 18:52:52 +0200
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <200107311626.f6VGQgj40774@latour.rsch.comm.mot.com>
Loren James Rittle <rittle@latour.rsch.comm.mot.com> writes:
| Instead of all the shenanigans to get this right in light of various
| glibc versions and command line switches that influence limits.h, how
| about we convert uses of LONG_LONG_MIN, LONG_LONG_MAX and
| ULONG_LONG_MAX to use __LONG_LONG_MAX__ (which is unconditionally
| defined by the gcc-generated limits.h file) when the former macros are
| not available. I will arbitrarily key off LONG_LONG_MIN.
An excellent suggestion!
| + #ifdef LONG_LONG_MIN
| DEFINE_EXTREMA(long long, LONG_LONG_MIN, LONG_LONG_MAX);
| DEFINE_EXTREMA(unsigned long long, 0, ULONG_LONG_MAX);
| + #else
| + DEFINE_EXTREMA(long long, (-__LONG_LONG_MAX__-1), __LONG_LONG_MAX__);
| + DEFINE_EXTREMA(unsigned long long, 0, (__LONG_LONG_MAX__ * 2ULL + 1));
| + #endif
Is the #ifdef bits necessary? Why not just use __LONG_LONG_MAX__
unconditionally?
Apart from that, the pacth looks pretty good and can go on branch and
mainline.
Thanks,
-- Gaby