#include <string.h>
#include <byteswap.h>
#include <errno.h>
-#include <endian.h>
#include <byteswap.h>
#include "pcm_local.h"
#endif
case SND_PCM_SFMT_U16_LE:
case SND_PCM_SFMT_U24_LE:
case SND_PCM_SFMT_U32_LE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return 0x8000800080008000UL;
-#elif defined(BIG_ENDIAN)
- return 0x0080008000800080UL;
#else
-#error "endian"
+ return 0x0080008000800080UL;
#endif
case SND_PCM_SFMT_U16_BE:
case SND_PCM_SFMT_U24_BE:
case SND_PCM_SFMT_U32_BE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return 0x0000008000000080UL;
-#elif defined(BIG_ENDIAN)
- return 0x8000000080000000UL;
#else
-#error "endian"
+ return 0x8000000080000000UL;
#endif
case SND_PCM_SFMT_FLOAT_LE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return (float)0.0;
-#elif defined(BIG_ENDIAN)
- return bswap_32((u_int32_t)((float)0.0));
#else
-#error "endian"
+ return bswap_32((u_int32_t)((float)0.0));
#endif
case SND_PCM_SFMT_FLOAT64_LE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return (double)0.0;
-#elif defined(BIG_ENDIAN)
- return bswap_64((u_int64_t)((double)0.0));
#else
-#error "endian"
+ return bswap_64((u_int64_t)((double)0.0));
#endif
case SND_PCM_SFMT_FLOAT_BE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return bswap_32((u_int32_t)((float)0.0));
-#elif defined(BIG_ENDIAN)
- return (float)0.0;
#else
-#error "endian"
+ return (float)0.0;
#endif
case SND_PCM_SFMT_FLOAT64_BE:
-#if defined(LITTLE_ENDIAN)
+#ifdef SND_LITTLE_ENDIAN
return bswap_64((u_int64_t)((double)0.0));
-#elif defined(BIG_ENDIAN)
- return (double)0.0;
#else
-#error "endian"
+ return (double)0.0;
#endif
case SND_PCM_SFMT_IEC958_SUBFRAME_LE:
case SND_PCM_SFMT_IEC958_SUBFRAME_BE:
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <endian.h>
#include <byteswap.h>
#include <sys/uio.h>
#include "../pcm_local.h"
sign = (snd_pcm_format_signed(src_format) !=
snd_pcm_format_signed(dst_format));
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifdef SND_LITTLE_ENDIAN
src_endian = snd_pcm_format_big_endian(src_format);
dst_endian = snd_pcm_format_big_endian(dst_format);
-#elif __BYTE_ORDER == __BIG_ENDIAN
+#else
src_endian = snd_pcm_format_little_endian(src_format);
dst_endian = snd_pcm_format_little_endian(dst_format);
-#else
-#error "Unsupported endian..."
#endif
if (src_endian < 0)
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <endian.h>
#include <byteswap.h>
#include <math.h>
#include "../pcm_local.h"
int sign, width, endian;
sign = !snd_pcm_format_signed(format);
width = snd_pcm_format_width(format) / 8 - 1;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifdef SND_LITTLE_ENDIAN
endian = snd_pcm_format_big_endian(format);
-#elif __BYTE_ORDER == __BIG_ENDIAN
- endian = snd_pcm_format_little_endian(format);
#else
-#error "Unsupported endian..."
+ endian = snd_pcm_format_little_endian(format);
#endif
if (endian < 0)
endian = 0;