endianness.patch 753 B

1234567891011121314151617181920
  1. diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
  2. index 10f86fd..4ace1bc 100644
  3. --- a/pjlib/include/pj/config.h
  4. +++ b/pjlib/include/pj/config.h
  5. @@ -245,7 +245,13 @@
  6. # define PJ_M_NAME "armv4"
  7. # define PJ_HAS_PENTIUM 0
  8. # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
  9. -# error Endianness must be declared for this processor
  10. +# if defined(__GNUC__)
  11. +# include <endian.h>
  12. +# define PJ_IS_LITTLE_ENDIAN __BYTE_ORDER__ == __LITTLE_ENDIAN__
  13. +# define PJ_IS_BIG_ENDIAN __BYTE_ORDER__ == __BIG_ENDIAN__
  14. +# else
  15. +# error Endianness must be declared for this processor
  16. +# endif
  17. # endif
  18. #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \