[xiph-commits] r12960 - in trunk/speex: libspeex src

jm at svn.xiph.org jm at svn.xiph.org
Thu May 17 08:37:20 PDT 2007


Author: jm
Date: 2007-05-17 08:37:20 -0700 (Thu, 17 May 2007)
New Revision: 12960

Modified:
   trunk/speex/libspeex/misc.h
   trunk/speex/src/wav_io.h
Log:
Better endianness detection (helps for MacOS X)


Modified: trunk/speex/libspeex/misc.h
===================================================================
--- trunk/speex/libspeex/misc.h	2007-05-17 15:10:10 UTC (rev 12959)
+++ trunk/speex/libspeex/misc.h	2007-05-17 15:37:20 UTC (rev 12960)
@@ -78,7 +78,7 @@
 /** Convert little endian */
 static inline spx_int32_t le_int(spx_int32_t i)
 {
-#ifdef WORDS_BIGENDIAN
+#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
    spx_uint32_t ui, ret;
    ui = i;
    ret =  ui>>24;

Modified: trunk/speex/src/wav_io.h
===================================================================
--- trunk/speex/src/wav_io.h	2007-05-17 15:10:10 UTC (rev 12959)
+++ trunk/speex/src/wav_io.h	2007-05-17 15:37:20 UTC (rev 12960)
@@ -35,7 +35,7 @@
 #include <stdio.h>
 #include "speex/speex_types.h"
 
-#ifdef WORDS_BIGENDIAN
+#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
 #define le_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8))
 #define be_short(s) ((short) (s))
 #else
@@ -46,7 +46,7 @@
 /** Convert little endian */
 static inline spx_int32_t le_int(spx_int32_t i)
 {
-#ifdef WORDS_BIGENDIAN
+#if !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
    spx_uint32_t ui, ret;
    ui = i;
    ret =  ui>>24;



More information about the commits mailing list