This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Determining whether long long is defined on a platform
- To: gcc at gcc dot gnu dot org
- Subject: Re: Determining whether long long is defined on a platform
- From: Ross Smith <ross dot s at ihug dot co dot nz>
- Date: Fri, 18 Aug 2000 09:35:39 +1200
- Organization: Ihug
- References: <4.3.2.7.2.20000817153348.03248f08@mail.prefres.com>
Matt Minnis wrote:
>
> Is there a automated way to determine if long long is defined or even valid
> on a given platform?
I do it this way:
#include <limits.h>
#if defined(LLONG_MAX) || defined(LONG_LONG_MAX)
// assume we have long long
#else
// assume we don't have long long
#endif
Probably not 100% reliable, but it's worked OK for me.
LLONG_MAX is the correct spelling according to C99, but GCC still uses
LONG_LONG_MAX (or did when I wrote the code; I haven't checked lately).
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"C++ is to programming as sex is to reproduction. Better ways might
technically exist but they're not nearly as much fun." -- Nikolai Irgens