#ifndef FORMATS_H
#define FORMATS_H 1
-#include <sys/types.h>
+#include <endian.h>
#include <byteswap.h>
/* Definitions for .VOC files */
/* 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')