Andreas Schwab <sch...@linux-m68k.org> wrote on 2010/02/11 17:35:54: > > Joakim Tjernlund <joakim.tjernl...@transmode.se> writes: > > > I am getting confused about on how to test for Endian in the kernel code. > > In user > > space one uses #if __BYTE_ORDER == __LITTLE_ENDIAN or #if __BYTE_ORDER == > > __BIG_ENDIAN > > > > I can see lots of kernel headers using this test too > > Only outside of __KERNEL__.
Ah, yes now I see. This is unfortunate as if one moves kernel code to user space and still use the kernel way: #ifdef __LITTLE_ENDIAN one will be in big trouble as including stdlib.h will define both __LITTLE_ENDIAN and __BIG_ENDIAN. Spent quite a while chasing that one down :( Jocke _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev