]> git.pld-linux.org Git - packages/mono.git/commitdiff
- kill stupid assumption, support little-endians with NO_UNALIGNED_ACCESS
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 18 Jun 2004 15:41:10 +0000 (15:41 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mono-endian.patch -> 1.1

mono-endian.patch [new file with mode: 0644]

diff --git a/mono-endian.patch b/mono-endian.patch
new file mode 100644 (file)
index 0000000..9d9f7bb
--- /dev/null
@@ -0,0 +1,22 @@
+--- mono-0.96/mono/interpreter/mintops.h.orig  2004-04-20 07:18:35.000000000 +0200
++++ mono-0.96/mono/interpreter/mintops.h       2004-06-18 17:36:33.000000000 +0200
+@@ -29,11 +29,19 @@
+ #undef OPDEF
+ #if NO_UNALIGNED_ACCESS
++#  if __BYTE_ORDER == __LITTLE_ENDIAN
++#define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
++#define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
++                   (guint64)((guint16 *)(x)) [1] << 16 | \
++                   (guint64)((guint16 *)(x)) [2] << 32 | \
++                   (guint64)((guint16 *)(x)) [3] << 48)
++#  else
+ #define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
+ #define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
+                    (guint64)((guint16 *)(x)) [1] << 32 | \
+                    (guint64)((guint16 *)(x)) [2] << 16 | \
+                    (guint64)((guint16 *)(x)) [3])
++#  endif
+ #else /* unaligned access OK */
+ #define READ32(x) (*(guint32 *)(x))
+ #define READ64(x) (*(guint64 *)(x))
This page took 0.14997 seconds and 4 git commands to generate.