This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Endian Macros - are there any defaults


Stan Katz wrote:
I know that gcc defines some preprocessor macros that let the
preprocessor generate different code for different architectures (I'm
using some of them) but I can't seem to find any that tell me about
either data format (big or little endian) or invocation options. Does
anyone know of anything I can use.

#include <endian.h>


#if __BYTE_ORDER == __LITTLE_ENDIAN
...
#elif __BYTE_ORDER == __BIG_ENDIAN
...
#endif

bits/endian.h is where __BYTE_ORDER is ultimately defined.

- Dan

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]