Alex James has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60233 )
Change subject: util/cbfstool: Avoid duplicate ntohll/htonll definitions ......................................................................
util/cbfstool: Avoid duplicate ntohll/htonll definitions
macOS defines these (as macros) when including arpa/inet.h. This resolves macro redefinition errors on macOS (tested on 10.15.7).
Change-Id: I54195865ab4042fcf83609fcf67ef8f33994d68e Signed-off-by: Alex James theracermaster@gmail.com --- M util/cbfstool/swab.h 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/60233/1
diff --git a/util/cbfstool/swab.h b/util/cbfstool/swab.h index a45a767..88e41a4 100644 --- a/util/cbfstool/swab.h +++ b/util/cbfstool/swab.h @@ -21,8 +21,12 @@ #else #include <arpa/inet.h> #endif +#ifndef ntohll #define ntohll(x) (is_big_endian() ? (uint64_t)(x) : swab64(x)) +#endif +#ifndef htonll #define htonll(x) (is_big_endian() ? (uint64_t)(x) : swab64(x)) +#endif
/* casts are necessary for constants, because we never know how for sure * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.