Use BB endianness macro.

This commit is contained in:
Rob Landley 2006-05-31 22:24:33 +00:00
parent b623a542df
commit c8b360ebb7

View File

@ -158,8 +158,7 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
option[OPT_CODE] = code; option[OPT_CODE] = code;
len = option_lengths[dh->flags & TYPE_MASK]; len = option_lengths[dh->flags & TYPE_MASK];
option[OPT_LEN] = len; option[OPT_LEN] = len;
if (__BYTE_ORDER == __BIG_ENDIAN) if (BB_BIG_ENDIAN) data <<= 8 * (4 - len);
data <<= 8 * (4 - len);
/* This memcpy is for broken processors which can't /* This memcpy is for broken processors which can't
* handle a simple unaligned 32-bit assignment */ * handle a simple unaligned 32-bit assignment */
memcpy(&option[OPT_DATA], &data, 4); memcpy(&option[OPT_DATA], &data, 4);