Enable big-endian build BUG=25017606 Change-Id: I8edea03a8d07a990db0cd4d77e60bc61fba6ce97 Reviewed-on: https://weave-review.googlesource.com/1632 Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/README b/README index bf9b70b..79b48f1 100644 --- a/README +++ b/README
@@ -130,7 +130,3 @@ repo upload . Go to the url from the output of "repo upload" and add reviewers. - -Known Issues ------------- -* No big-endian support. Pairing fails on big-endian hardware.
diff --git a/src/privet/security_manager.cc b/src/privet/security_manager.cc index 19e8c18..7e35e79 100644 --- a/src/privet/security_manager.cc +++ b/src/privet/security_manager.cc
@@ -24,10 +24,6 @@ #include "src/string_utils.h" #include "third_party/chromium/crypto/p224_spake.h" -#if !defined(ARCH_CPU_LITTLE_ENDIAN) -#error "Big-endian is not supported. See b/25017606" -#endif - namespace weave { namespace privet {
diff --git a/third_party/modp_b64/modp_b64.cc b/third_party/modp_b64/modp_b64.cc index fdb8a40..8db2ed1 100644 --- a/third_party/modp_b64/modp_b64.cc +++ b/third_party/modp_b64/modp_b64.cc
@@ -45,16 +45,12 @@ /* public header */ #include "modp_b64.h" -/* - * If you are ripping this out of the library, comment out the next - * line and uncomment the next lines as approrpiate - */ -//#include "config.h" +#include <base/build/build_config.h> -/* if on motoral, sun, ibm; uncomment this */ -/* #define WORDS_BIGENDIAN 1 */ -/* else for Intel, Amd; uncomment this */ -/* #undef WORDS_BIGENDIAN */ +#undef WORDS_BIGENDIAN +#if !defined(ARCH_CPU_LITTLE_ENDIAN) +#define WORDS_BIGENDIAN 1 +#endif #include "modp_b64_data.h" @@ -118,7 +114,7 @@ } #ifdef WORDS_BIGENDIAN /* BIG ENDIAN -- SUN / IBM / MOTOROLA */ -int modp_b64_decode(char* dest, const char* src, int len) +size_t modp_b64_decode(char* dest, const char* src, size_t len) { if (len == 0) return 0;