summaryrefslogtreecommitdiff
path: root/wsutil/pint.h
diff options
context:
space:
mode:
Diffstat (limited to 'wsutil/pint.h')
-rw-r--r--wsutil/pint.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/wsutil/pint.h b/wsutil/pint.h
index 02012537ee..ecea5fc94a 100644
--- a/wsutil/pint.h
+++ b/wsutil/pint.h
@@ -137,6 +137,17 @@
((guint8*)(p))[3] = (guint8)((v) >> 0); \
}
+static inline void phton64(guint8 *p, guint64 v) {
+ p[0] = (guint8)(v >> 56);
+ p[1] = (guint8)(v >> 48);
+ p[2] = (guint8)(v >> 40);
+ p[3] = (guint8)(v >> 32);
+ p[4] = (guint8)(v >> 24);
+ p[5] = (guint8)(v >> 16);
+ p[6] = (guint8)(v >> 8);
+ p[7] = (guint8)(v >> 0);
+}
+
/* Subtract two guint32s with respect to wraparound */
#define guint32_wraparound_diff(higher, lower) ((higher>lower)?(higher-lower):(higher+0xffffffff-lower+1))