From abe718c7cf4ecad66cf41e1563b372f34a339361 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 22 Aug 2001 11:00:07 +0000 Subject: [PATCH] Corrected endian test --- aplay/formats.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aplay/formats.h b/aplay/formats.h index d84652b..f61db3b 100644 --- a/aplay/formats.h +++ b/aplay/formats.h @@ -1,7 +1,7 @@ #ifndef FORMATS_H #define FORMATS_H 1 -#include +#include #include /* 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')