pimd: fix nonstandard endian check

One can look at `BYTE_ORDER` and `BIG_ENDIAN` (which are from
`endian.h`) or at `__BYTE_ORDER__` and `__BIG_ENDIAN__` (which the
compilers set without even including anything), but - `__BYTE_ORDER` and
`__BIG_ENDIAN` are the one thing that is a nonstandard extra, and in
fact missing on some of the BSDs.

Just use the plain one without underscores.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2025-05-23 16:24:58 +02:00
parent 1163c090b5
commit b5c2e5d8df

View file

@ -31,14 +31,14 @@ PREDECL_SORTLIST_UNIQ(pim_autorp_rp);
PREDECL_SORTLIST_UNIQ(pim_autorp_grppfix);
struct autorp_pkt_grp {
#if __BYTE_ORDER == __LITTLE_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
uint8_t negprefix : 1;
uint8_t reserved : 7;
#elif __BYTE_ORDER == __BIG_ENDIAN
#elif BYTE_ORDER == BIG_ENDIAN
uint8_t reserved : 7;
uint8_t negprefix : 1;
#else
#error "Please fix <bits/endian.h>"
#error "Please fix <endian.h>"
#endif
uint8_t masklen;
uint32_t addr;
@ -46,27 +46,27 @@ struct autorp_pkt_grp {
struct autorp_pkt_rp {
uint32_t addr;
#if __BYTE_ORDER == __LITTLE_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
uint8_t pimver : 2;
uint8_t reserved : 6;
#elif __BYTE_ORDER == __BIG_ENDIAN
#elif BYTE_ORDER == BIG_ENDIAN
uint8_t reserved : 6;
uint8_t pimver : 2;
#else
#error "Please fix <bits/endian.h>"
#error "Please fix <endian.h>"
#endif
uint8_t grpcnt;
} __attribute__((__packed__));
struct autorp_pkt_hdr {
#if __BYTE_ORDER == __LITTLE_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
uint8_t type : 4;
uint8_t version : 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
#elif BYTE_ORDER == BIG_ENDIAN
uint8_t version : 4;
uint8_t type : 4;
#else
#error "Please fix <bits/endian.h>"
#error "Please fix <endian.h>"
#endif
uint8_t rpcnt;
uint16_t holdtime;