mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-23 02:46:30 +01:00
Corrected endian test
This commit is contained in:
parent
f7b6aa50e6
commit
abe718c7cf
1 changed files with 5 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue