libcoap: fix big endian problems
authorHauke Mehrtens <hauke.mehrtens@lantiq.com>
Mon, 8 Jun 2015 19:57:52 +0000 (21:57 +0200)
committerErich Keane <erich.keane@intel.com>
Wed, 17 Jun 2015 15:34:07 +0000 (15:34 +0000)
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 <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1219
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/lib/libcoap-4.1.1/config.h

index 6d2beb6..71d396a 100644 (file)
 #  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