From 33cd3cfa1d21d9f3557f01a137bec43322a3ec93 Mon Sep 17 00:00:00 2001 From: Shahid Date: Sat, 2 Feb 2019 00:46:46 +0530 Subject: Update varint.int.h --- upb/pb/varint.int.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'upb') diff --git a/upb/pb/varint.int.h b/upb/pb/varint.int.h index 9c54311..5de1296 100644 --- a/upb/pb/varint.int.h +++ b/upb/pb/varint.int.h @@ -9,6 +9,7 @@ #include #include #include +#include #include "upb/upb.h" #ifdef __cplusplus @@ -130,6 +131,9 @@ UPB_INLINE uint64_t upb_vencode32(uint32_t val) { uint64_t ret = 0; UPB_ASSERT(bytes <= 5); memcpy(&ret, buf, bytes); +#ifdef UPB_BIG_ENDIAN + ret = bswap_64(ret); +#endif UPB_ASSERT(ret <= 0xffffffffffU); return ret; } -- cgit v1.2.3