changeset 2475:a5f1c47cee0c

Use Glib endianess macros.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 30 Mar 2008 01:25:40 +0200
parents f2b3cdb6e7dc
children 809736eb47d9
files src/sid/xs_md5.c src/sid/xs_sidplay2.cc
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/sid/xs_md5.c	Sun Mar 30 01:16:00 2008 +0200
+++ b/src/sid/xs_md5.c	Sun Mar 30 01:25:40 2008 +0200
@@ -12,9 +12,10 @@
 #include <glib.h>
 
 
-#ifndef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define xs_md5_bytereverse(buf, len)	/* Nothing */
 #else
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 void xs_md5_bytereverse(guint8 *buf, guint l)
 {
 	guint32 t;
@@ -24,6 +25,9 @@
 		buf += sizeof(guint32);
 	} while (--l);
 }
+#else
+#error Unsupported endianess!
+#endif
 #endif
 
 
--- a/src/sid/xs_sidplay2.cc	Sun Mar 30 01:16:00 2008 +0200
+++ b/src/sid/xs_sidplay2.cc	Sun Mar 30 01:25:40 2008 +0200
@@ -173,10 +173,14 @@
 			break;
 
 		case FMT_U16_NE:
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 			myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
 #else
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 			myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
+#else
+#error Unsupported endianess!
+#endif
 #endif
 			break;
 
@@ -190,10 +194,14 @@
 
 		default:
 			myStatus->audioFormat = FMT_S16_NE;
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 			myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
 #else
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 			myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
+#else
+#error Unsupported endianess!
+#endif
 #endif
 			break;