Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
 include/qemu/compiler.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 1c2b673c05..4b9a8ff419 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -9,6 +9,17 @@
 
 #define HOST_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
 
+/*
+ * Place two fields, LO, HI, in the order that corresponds to
+ * the host-endian ordering.  To be used when the pair will be
+ * visible through a union with a larger type.
+ */
+#if HOST_BIG_ENDIAN
+#define HOST_ENDIAN_FIELDS(LO, HI)  HI, LO
+#else
+#define HOST_ENDIAN_FIELDS(LO, HI)  LO, HI
+#endif
+
 /* HOST_LONG_BITS is the size of a native pointer in bits. */
 #define HOST_LONG_BITS (__SIZEOF_POINTER__ * 8)
 
-- 
2.43.0


Reply via email to