Alex James has uploaded this change for review. ( https://review.coreboot.org/c/vboot/+/60235 )
Change subject: cgpt: Add endian definitions for macOS ......................................................................
cgpt: Add endian definitions for macOS
macOS does not provide endian.h (Linux) or sys/endian.h (FreeBSD). OSByteOrder.h and endian.h provide similar definitions, so include them on macOS. This resolves compilation errors when compiling coreboot on macOS 10.15.7.
Change-Id: I87e98ea157870417f5eba63807eef559e180d1f8 Signed-off-by: Alex James theracermaster@gmail.com --- M cgpt/cgpt_endian.h 1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/vboot refs/changes/35/60235/1
diff --git a/cgpt/cgpt_endian.h b/cgpt/cgpt_endian.h index f59ab1b..6a7d7e7 100644 --- a/cgpt/cgpt_endian.h +++ b/cgpt/cgpt_endian.h @@ -9,6 +9,15 @@ // Newer distros already have this. For those that don't, we add it here. #if !defined(HAVE_MACOS) && !defined(__FreeBSD__) #include <endian.h> +#elif defined(HAVE_MACOS) +#include <libkern/OSByteOrder.h> +#include <machine/endian.h> +#define __BYTE_ORDER BYTE_ORDER +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __BIG_ENDIAN BIG_ENDIAN +#define __bswap_16(x) OSSwapInt16 (x) +#define __bswap_32(x) OSSwapInt32 (x) +#define __bswap_64(x) OSSwapInt64 (x) #elif defined(__FreeBSD__) #include <sys/endian.h> #endif