summaryrefslogtreecommitdiff
path: root/upb
diff options
context:
space:
mode:
authorShahid <shahid@us.ibm.com>2019-02-02 00:46:46 +0530
committerGitHub <noreply@github.com>2019-02-02 00:46:46 +0530
commit33cd3cfa1d21d9f3557f01a137bec43322a3ec93 (patch)
tree5d3d75f6af86c80c74a80c7e5af3de458a5b2d63 /upb
parentafaa22eb3d5a5b80d7a0a4909df789d25a7b4783 (diff)
Update varint.int.h
Diffstat (limited to 'upb')
-rw-r--r--upb/pb/varint.int.h4
1 files changed, 4 insertions, 0 deletions
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 <assert.h>
#include <stdint.h>
#include <string.h>
+#include <byteswap.h>
#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;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback