]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Corrected endian test
authorJaroslav Kysela <perex@perex.cz>
Wed, 22 Aug 2001 11:00:07 +0000 (11:00 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 22 Aug 2001 11:00:07 +0000 (11:00 +0000)
aplay/formats.h

index d84652bff270339348e65b338fe2c74de8b6e189..f61db3b0e8de700916d7db7a28597e5e689d1289 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef FORMATS_H
 #define FORMATS_H              1
 
-#include <sys/types.h>
+#include <endian.h>
 #include <byteswap.h>
 
 /* Definitions for .VOC files */
@@ -44,18 +44,20 @@ typedef struct voc_ext_block {
 
 /* Definitions for Microsoft WAVE format */
 
-#ifdef SND_LITTLE_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN
 #define COMPOSE_ID(a,b,c,d)    ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
 #define LE_SHORT(v)            (v)
 #define LE_INT(v)              (v)
 #define BE_SHORT(v)            bswap_16(v)
 #define BE_INT(v)              bswap_32(v)
-#else
+#elif __BYTE_ORDER == __BIG_ENDIAN
 #define COMPOSE_ID(a,b,c,d)    ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
 #define LE_SHORT(v)            bswap_16(v)
 #define LE_INT(v)              bswap_32(v)
 #define BE_SHORT(v)            (v)
 #define BE_INT(v)              (v)
+#else
+#error "Wrong endian"
 #endif
 
 #define WAV_RIFF               COMPOSE_ID('R','I','F','F')