Skip to content

Commit

Permalink
Use autoconf to look for the right endian.h header.
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Sep 25, 2023
1 parent 338eef5 commit 333b005
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PKG_CHECK_MODULES(LCFS_DEP_CRYPTO, libcrypto,[
])
AM_CONDITIONAL(USE_OPENSSL, test $with_openssl != no)

AC_CHECK_HEADERS([sys/capability.h])
AC_CHECK_HEADERS([sys/capability.h endian.h sys/endian.h machine/endian.h])

AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
Expand Down
2 changes: 1 addition & 1 deletion libcomposefs/lcfs-fsverity.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <endian.h>
#include <assert.h>
#include <string.h>
#include <sys/param.h>
Expand Down Expand Up @@ -298,6 +297,7 @@ static void sha256_sum_close(Sha256sum *sha256, uint8_t *digest)

#endif /* SHA256 fallback implementation */

#include "lcfs-internal.h" /* for endian.h */
#include "lcfs-fsverity.h"

struct fsverity_descriptor {
Expand Down
10 changes: 10 additions & 0 deletions libcomposefs/lcfs-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@
#ifndef _LCFS_INTERNAL_H
#define _LCFS_INTERNAL_H

#ifdef HAVE_MACHINE_ENDIAN_H
#include <machine/endian.h>
#endif

#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif

#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif

#include "lcfs-writer.h"
#include "lcfs-fsverity.h"
Expand Down

0 comments on commit 333b005

Please sign in to comment.