1 #ifndef _MONO_METADATA_ENDIAN_H_
2 #define _MONO_METADATA_ENDIAN_H_ 1
14 unsigned char cval
[8];
18 #define MONO_DOUBLE_ASSERT_ENDIANITY(dbl_ptr) \
22 r.ival = (guint64) *((guint32 *) r.cval) << 32 | \
23 *((guint32 *) (r.cval + 4)); \
27 #define MONO_DOUBLE_ASSERT_ENDIANITY(dbl_ptr)
30 #if NO_UNALIGNED_ACCESS
32 guint16
mono_read16 (const unsigned char *x
);
33 guint32
mono_read32 (const unsigned char *x
);
34 guint64
mono_read64 (const unsigned char *x
);
36 #define read16(x) (mono_read16 ((const unsigned char *)(x)))
37 #define read32(x) (mono_read32 ((const unsigned char *)(x)))
38 #define read64(x) (mono_read64 ((const unsigned char *)(x)))
42 #define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x)))
43 #define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x)))
44 #define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x)))
48 #define readr4(x,dest) \
51 mf.ival = read32 ((x)); \
55 #define readr8(x,dest) \
58 mf.ival = read64 ((x)); \
59 MONO_DOUBLE_ASSERT_ENDIANITY (&mf.fval); \
63 #endif /* _MONO_METADATA_ENDIAN_H_ */