BYTE_ORDER

pek at kth.se pek
Tue Jun 12 06:36:37 PDT 2012


Whats the story with the *BYTE_ORDER macros?

crypto/md4-internal.c checks BYTE_ORDER, is this a bug?
It is unclear to me if this is ever defined in the general case.

eap_peer/ikev2.c checks __BYTE_ORDER

driver_atheros.c can define _BYTE_ORDER (but doesn't use it). It doesn't
feel like this file should diddle around with these macros at all.

It seems to the uninitiated that __BYTE_ORDER is the macro that all code
is intended to use since common.h defines it. Is this correct?

find . -name "*.[hc]" -exec grep -H BYTE_ORDER {} \;
./src/eap_peer/ikev2.c:#if __BYTE_ORDER == __LITTLE_ENDIAN
./src/drivers/driver_atheros.c:#ifndef _BYTE_ORDER
./src/drivers/driver_atheros.c:#define _BYTE_ORDER _BIG_ENDIAN
./src/drivers/driver_atheros.c:#define _BYTE_ORDER _LITTLE_ENDIAN
./src/drivers/driver_atheros.c:#endif /* _BYTE_ORDER */
./src/utils/common.h:#define __BYTE_ORDER       _BYTE_ORDER
./src/utils/common.h:#define __BYTE_ORDER       _BYTE_ORDER
./src/utils/common.h:#define __BYTE_ORDER __BIG_ENDIAN
./src/utils/common.h:#define __BYTE_ORDER __LITTLE_ENDIAN
./src/utils/common.h:#ifndef __BYTE_ORDER
./src/utils/common.h:#define __BYTE_ORDER __BIG_ENDIAN
./src/utils/common.h:#endif /* __BYTE_ORDER */
./src/utils/common.h:#if __BYTE_ORDER == __LITTLE_ENDIAN
./src/utils/common.h:#elif __BYTE_ORDER == __BIG_ENDIAN
./src/crypto/md4-internal.c:#if BYTE_ORDER == LITTLE_ENDIAN

Sincerely
Per Ekman
H&D Wireless AB



More information about the Hostap mailing list