From 62c0a14ccd333d0e55fc431f151253a72a2836d0 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 8 Jun 2015 21:57:52 +0200 Subject: [PATCH] libcoap: fix big endian problems When this is build for a big endian Linux system WORDS_BIGENDIAN was not be set. This patch sets it correctly so it will not generate broken code on big endian systems. This was tested on MIPS BE 32 Bit. Change-Id: I59dd07d8020c553318e2aa43894a2185fe9b9286 Signed-off-by: Hauke Mehrtens Reviewed-on: https://gerrit.iotivity.org/gerrit/1219 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- resource/csdk/connectivity/lib/libcoap-4.1.1/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/resource/csdk/connectivity/lib/libcoap-4.1.1/config.h +++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/config.h @@ -135,8 +135,8 @@ # define WORDS_BIGENDIAN 1 # endif #else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ +# if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +# define WORDS_BIGENDIAN 1 # endif #endif