[parisc-linux] [PATCH] include/linux/soundcard.h endian fix

Randolph Chung randolph at tausq.org
Mon Feb 23 05:24:58 MST 2004


> Would it be better to do the following? :
> 
> #ifdef(__BYTE_ORDER)
> #  if defined(__BIG_ENDIAN)
> #    if __BYTE_ORDER == __BIG_ENDIAN
> #      define AFMT_S16_NE AFMT_S16_BE
> #    endif
> #  elif defined(__LITTLE_ENDIAN)
> #    if __BYTE_ORDER == __LITTLE_ENDIAN
> #      define AFMT_S16_NE AFMT_S16_LE
> #    endif
> #  end if
> #endif

yes, this is much better. If you include asm/byteorder.h then this
should always be defined. maybe add a #error to catch the (unlikely)
case where neither is defined?

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


More information about the parisc-linux mailing list