Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38648 )
Change subject: util/cbfstool: extend includes in commonlib ......................................................................
util/cbfstool: extend includes in commonlib
Certain non-Linux OSes require an include file in different places.
Build tested on Linux, FreeBSD.
Change-Id: Icd81c2a96c608589ce2ec8f4b883fd4e584776b1 Signed-off-by: Idwer Vollering vidwer@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/38648 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Julius Werner jwerner@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- A src/commonlib/bsd/include/commonlib/bsd/sysincludes.h M src/commonlib/bsd/lz4_wrapper.c 2 files changed, 7 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/commonlib/bsd/include/commonlib/bsd/sysincludes.h b/src/commonlib/bsd/include/commonlib/bsd/sysincludes.h new file mode 100644 index 0000000..3a87cda --- /dev/null +++ b/src/commonlib/bsd/include/commonlib/bsd/sysincludes.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only */ +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else +#include <endian.h> +#endif diff --git a/src/commonlib/bsd/lz4_wrapper.c b/src/commonlib/bsd/lz4_wrapper.c index 3822e8c..73185a5 100644 --- a/src/commonlib/bsd/lz4_wrapper.c +++ b/src/commonlib/bsd/lz4_wrapper.c @@ -2,7 +2,7 @@
#include <commonlib/bsd/compression.h> #include <commonlib/bsd/helpers.h> -#include <endian.h> +#include <commonlib/bsd/sysincludes.h> #include <stdint.h> #include <string.h>