Ralph Giles wrote:
> On 5 February 2012 01:41, Erik de Castro Lopo <[email protected]> wrote:
>
> > a) On Linux, use the bswap_*() intrinsic.
>
> FWIW, Both Apple llvm-gcc 4.2.1 and Apple clang 3.0 support
> __builtin_bswap32() At least on XCode 4.2. It compiles to the bswap
> instruction.
Ok, I have an M4 macro to detect the presence of __builtin_bswap32()
and I've tested it on BE and LE linux.
The scheme now is:
a) Use __builtin_bswap32() where present (should be all versions of
GCC and Clang).
b) Use _byteswap_ulong() under MSVC.
c) Use bwap32() if <byteswap.h> is present.
d) Fall back to a macro.
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev