From: Christian Storm <[email protected]> The headers bootguard.h and utils.h mutually #include each other for no apparent reason. Hence, disentangle their #include relation to allow selective inclusion.
One problem of this is, e.g., utils.h defines _VOLUME_DESC after #include "bootguard.h". However, bootguard.h uses this in extern VOLUME_DESC *volumes. Signed-off-by: Christian Storm <[email protected]> --- bootguard.c | 1 + env/fatvars.c | 1 + include/bootguard.h | 6 ------ include/utils.h | 6 +++++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bootguard.c b/bootguard.c index 22a2a8a..55811dd 100644 --- a/bootguard.c +++ b/bootguard.c @@ -13,6 +13,7 @@ */ #include "bootguard.h" +#include "utils.h" EFI_HANDLE this_image; diff --git a/env/fatvars.c b/env/fatvars.c index e86743e..5c63212 100644 --- a/env/fatvars.c +++ b/env/fatvars.c @@ -13,6 +13,7 @@ */ #include <bootguard.h> +#include <utils.h> #include <syspart.h> #include <envdata.h> diff --git a/include/bootguard.h b/include/bootguard.h index 5c99264..99d8fe4 100644 --- a/include/bootguard.h +++ b/include/bootguard.h @@ -15,9 +15,6 @@ #pragma once #include <efi.h> -#include <efilib.h> -#include <efiprot.h> -#include <utils.h> /* The following definitions regarding status and error constants are * implemented the same way the corresponding gnu-efi constants are @@ -38,9 +35,6 @@ typedef int BG_STATUS; extern EFI_HANDLE this_image; -extern VOLUME_DESC *volumes; -extern UINTN volume_count; - typedef struct _BG_LOADER_PARAMS { CHAR16 *payload_path; CHAR16 *payload_options; diff --git a/include/utils.h b/include/utils.h index a6fbab7..b496031 100644 --- a/include/utils.h +++ b/include/utils.h @@ -15,7 +15,8 @@ #pragma once -#include "bootguard.h" +#include <efi.h> +#include <efilib.h> #define MAX_INFO_SIZE 1024 @@ -26,6 +27,9 @@ typedef struct _VOLUME_DESC { EFI_FILE_HANDLE root; } VOLUME_DESC; +extern VOLUME_DESC *volumes; +extern UINTN volume_count; + typedef enum { DOSFSLABEL, CUSTOMLABEL, NOLABEL } LABELMODE; uint32_t calc_crc32(void *data, int32_t size); -- 2.30.0 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20210110092358.17810-1-christian.storm%40siemens.com.
