On Fri, 16 Nov 2001, John R. Daily wrote:

> If glibc is to be believed (/usr/include/limits.h), gcc should
> be defining __WORDSIZE.
> 
> gcc versions 2.95, 2.96, and 3.0 have been tested; none of
> them seem to define it.
> 
> As it is, there doesn't seem to be a good way to distinguish
> 32 bit from 64 bit platforms at compile time.
> 
> Is this a misunderstanding on glibc's part? Where should
> __WORDSIZE be defined, and what alternatives exist?

It's defined in bits/wordsize.h, which is #included from <limits.h>, so it
should be ok in all cases that you #include <limits.h>.  No platform that
I know of has a cc that includes the wordsize in the compiler specs...they
usually rely on headers to supply that info, IIRC (they definitely do on
linux targets).

Ok to close or do you want to discuss it a bit more?  I'm open to
suggestion :-)

C


Reply via email to