Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / mono-endian.c
index 2b1fdd0f42c88eb9ce374ac14a5f4e8fb34aaca2..d7822c72ff6306bcdd732310b8a2555085d2e50b 100644 (file)
@@ -1,3 +1,15 @@
+/**
+ * \file
+ *
+ * Author:
+ *     Mono Project (http://www.mono-project.com)
+ *
+ * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
+ * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <mono/utils/mono-compiler.h>
 #include "mono-endian.h"
 
 #if NO_UNALIGNED_ACCESS
@@ -21,7 +33,7 @@ guint16
 mono_read16 (const unsigned char *x)
 {
        mono_rint16 r;
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
        r.c [0] = x [0];
        r.c [1] = x [1];
 #else
@@ -35,7 +47,7 @@ guint32
 mono_read32 (const unsigned char *x)
 {
        mono_rint32 r;
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
        r.c [0] = x [0];
        r.c [1] = x [1];
        r.c [2] = x [2];
@@ -53,7 +65,7 @@ guint64
 mono_read64 (const unsigned char *x)
 {
        mono_rint64 r;
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
        r.c [0] = x [0];
        r.c [1] = x [1];
        r.c [2] = x [2];
@@ -75,4 +87,8 @@ mono_read64 (const unsigned char *x)
        return r.i;
 }
 
+#else /* NO_UNALIGNED_ACCESS */
+
+MONO_EMPTY_SOURCE_FILE (mono_endian);
+
 #endif