home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / unixlib / h / endian < prev    next >
Encoding:
Text File  |  2006-09-17  |  1.2 KB  |  44 lines

  1. /* Define byte-sex for the host system.
  2.    Copyright (c) 2004, 2005 UnixLib Developers.  */
  3.  
  4. #ifndef    __ENDIAN_H
  5. #define    __ENDIAN_H    1
  6.  
  7. #include <features.h>
  8.  
  9. /* Definitions for byte order, according to significance of bytes, from low
  10.    addresses to high addresses.  The value is what you get by putting '4'
  11.    in the most significant byte, '3' in the second most significant byte,
  12.    '2' in the second least significant byte, and '1' in the least
  13.    significant byte.  */
  14.  
  15. #define    __LITTLE_ENDIAN    1234
  16. #define    __BIG_ENDIAN    4321
  17. #define    __PDP_ENDIAN    3412
  18.  
  19. /* Byte order for RISC OS is little endian.  */
  20. #define __BYTE_ORDER __LITTLE_ENDIAN
  21.  
  22. #ifdef __USE_BSD
  23. /* For compatibility with BSD.  */
  24. #define    LITTLE_ENDIAN    __LITTLE_ENDIAN
  25. #define    BIG_ENDIAN    __BIG_ENDIAN
  26. #define    PDP_ENDIAN    __PDP_ENDIAN
  27. #define    BYTE_ORDER    __BYTE_ORDER
  28. #endif
  29.  
  30. /* Define the floating-point compatibility macros.  */
  31.  
  32. #ifdef __SOFTFP__
  33. /* Software floating point, utilises big-endial words.  */
  34. #define __FLOAT_BIT_ORDER __BIG_ENDIAN
  35. #define __FLOAT_WORD_ORDER __BIG_ENDIAN
  36. #else
  37. /* ARM/FPA format uses an inconsistent mix of little-endian words,
  38.    stored in a big endian order. */
  39. #define __FLOAT_BIT_ORDER __LITTLE_ENDIAN
  40. #define __FLOAT_WORD_ORDER __BIG_ENDIAN
  41. #endif
  42.  
  43. #endif
  44.