Pre defined #defines for different cross compilers ?

Dan Kegel dank@kegel.com
Tue Sep 30 01:47:00 GMT 2003


Anton Erasmus wrote:
> Are there any documentation that describes the more generic #defines ?
> I.e. Like a #define which is defined if the compiler generates Big Endian code,
> or a #define which is defined if int is 32bit.
> The idea is to try and write code which will be portable even across future versions
> of gcc for 64 bit and other architectures. 

#include <stdint.h> is the place to go for int size portability, I think.

There is some notion of endianness defined in
#include <endian.h>
Not sure how portable that is, though.

Otherwise, autoconf's the place to go for that sort of thing, really.
The newer versions of autoconf are pretty good; I use
them for detecting endianness at compile time,
and they don't rely on any gcc extensions.
- Dan


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list