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


Daniel Kegel wrote:
>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.

I can't find any endian.h file on my system, that may be because
unfortunately I'm using newlib hosted on Cygwin but the file isn't part
of either gcc 2.95.2, 3.1 or 3.2 or Newlib 1.8.0 or 1.12.0 for either
ARM or SH (or for Cygwin).

Thanks - it would have been nice if I had found the file, embarrassing,
but nice.

Stan

------
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]