summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/platform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h
index b81c59d..c365d5c 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -260,6 +260,11 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
+/* unxz needs an aligned fixed-endian accessor.
+ * (however, the compiler does not realize it's aligned, the cast is still necessary)
+ */
+#define get_le32(u32p) ({ uint32_t v = *(bb__aliased_uint32_t*)(u32p); SWAP_LE32(v); })
+
/* ---- Size-saving "small" ints (arch-dependent) ----------- */