diff options
Diffstat (limited to 'lib/unaligned.h')
-rw-r--r-- | lib/unaligned.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/unaligned.h b/lib/unaligned.h index dc777fbf..b02bc6fe 100644 --- a/lib/unaligned.h +++ b/lib/unaligned.h @@ -45,6 +45,12 @@ get_u64(const void *p) } static inline void +put_u8(void *p, u8 x) +{ + memcpy(p, &x, 1); +} + +static inline void put_u16(void *p, u16 x) { x = htons(x); |