You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. From 62c0a14ccd333d0e55fc431f151253a72a2836d0 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
  3. Date: Mon, 8 Jun 2015 21:57:52 +0200
  4. Subject: [PATCH] libcoap: fix big endian problems
  5. When this is build for a big endian Linux system WORDS_BIGENDIAN was
  6. not be set. This patch sets it correctly so it will not generate broken
  7. code on big endian systems.
  8. This was tested on MIPS BE 32 Bit.
  9. Change-Id: I59dd07d8020c553318e2aa43894a2185fe9b9286
  10. Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
  11. Reviewed-on: https://gerrit.iotivity.org/gerrit/1219
  12. Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
  13. Reviewed-by: Erich Keane <erich.keane@intel.com>
  14. ---
  15. resource/csdk/connectivity/lib/libcoap-4.1.1/config.h | 4 ++--
  16. 1 file changed, 2 insertions(+), 2 deletions(-)
  17. --- a/resource/csdk/connectivity/lib/libcoap-4.1.1/config.h
  18. +++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/config.h
  19. @@ -135,8 +135,8 @@
  20. # define WORDS_BIGENDIAN 1
  21. # endif
  22. #else
  23. -# ifndef WORDS_BIGENDIAN
  24. -/* # undef WORDS_BIGENDIAN */
  25. +# if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  26. +# define WORDS_BIGENDIAN 1
  27. # endif
  28. #endif