summaryrefslogtreecommitdiffstats
path: root/common/parse.h
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-08-05 20:14:20 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-08-05 20:14:20 -0700
commit6c07ee0ba39c869b5a092e1c5de698da976e6953 (patch)
treee43614ed3d6c68917bd0739e5ec983b5dc507572 /common/parse.h
parente427113fa856cd8e7a30fd1c4b904f4396180ca7 (diff)
downloadxrdp-proprietary-6c07ee0ba39c869b5a092e1c5de698da976e6953.tar.gz
xrdp-proprietary-6c07ee0ba39c869b5a092e1c5de698da976e6953.zip
added in_uint64_le
Diffstat (limited to 'common/parse.h')
-rw-r--r--common/parse.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/common/parse.h b/common/parse.h
index 226e246b..f92e76de 100644
--- a/common/parse.h
+++ b/common/parse.h
@@ -184,6 +184,31 @@ struct stream
#endif
/******************************************************************************/
+#if defined(B_ENDIAN) || defined(NEED_ALIGN)
+#define in_uint64_le(s, v) do \
+{ \
+ (v) = (tui64) \
+ ( \
+ (((tui64)(*((unsigned char*)((s)->p + 0)))) << 0) | \
+ (((tui64)(*((unsigned char*)((s)->p + 1)))) << 8) | \
+ (((tui64)(*((unsigned char*)((s)->p + 2)))) << 16) | \
+ (((tui64)(*((unsigned char*)((s)->p + 3)))) << 24) | \
+ (((tui64)(*((unsigned char*)((s)->p + 4)))) << 32) | \
+ (((tui64)(*((unsigned char*)((s)->p + 5)))) << 40) | \
+ (((tui64)(*((unsigned char*)((s)->p + 6)))) << 48) | \
+ (((tui64)(*((unsigned char*)((s)->p + 7)))) << 56) \
+ ); \
+ (s)->p += 8; \
+} while (0)
+#else
+#define in_uint64_le(s, v) do \
+{ \
+ (v) = *((tui64*)((s)->p)); \
+ (s)->p += 8; \
+} while (0)
+#endif
+
+/******************************************************************************/
#define in_uint32_be(s, v) do \
{ \
(v) = *((unsigned char*)((s)->p)); \