5 #ifndef _MONO_METADATA_ENDIAN_H_
6 #define _MONO_METADATA_ENDIAN_H_ 1
18 unsigned char cval
[8];
21 #if defined(__s390x__)
23 #define read16(x) __builtin_bswap16(*((guint16 *)(x)))
24 #define read32(x) __builtin_bswap32(*((guint32 *)(x)))
25 #define read64(x) __builtin_bswap64(*((guint64 *)(x)))
29 # if NO_UNALIGNED_ACCESS
31 guint16
mono_read16 (const unsigned char *x
);
32 guint32
mono_read32 (const unsigned char *x
);
33 guint64
mono_read64 (const unsigned char *x
);
35 #define read16(x) (mono_read16 ((const unsigned char *)(x)))
36 #define read32(x) (mono_read32 ((const unsigned char *)(x)))
37 #define read64(x) (mono_read64 ((const unsigned char *)(x)))
41 #define read16(x) GUINT16_FROM_LE (*((const guint16 *) (x)))
42 #define read32(x) GUINT32_FROM_LE (*((const guint32 *) (x)))
43 #define read64(x) GUINT64_FROM_LE (*((const guint64 *) (x)))
49 #define readr4(x,dest) \
52 mf.ival = read32 ((x)); \
56 #define readr8(x,dest) \
59 mf.ival = read64 ((x)); \
63 #endif /* _MONO_METADATA_ENDIAN_H_ */