This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
macros to detect endiannes?
- From: Kimmo Fredriksson <kfredrik at cs dot joensuu dot fi>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 29 Aug 2003 20:02:07 +0300 (EET DST)
- Subject: macros to detect endiannes?
- References: <8184363.1053619149459.JavaMail.nobody@wamui02.slb.atl.earthlink.net>
Hi,
I have some source that makes assumptions on the endiannes of the
architecture. To make it more portable I'd like write specific code for
both little and big endian machines. Are there any predefined macros that
could be used to detect the endiannes at compile time, that I could use in
conditional compilation?
Thanks,
kf