diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h index 0e029632..a1ba4966 100644 --- a/src/include/ipxe/efi/efi.h +++ b/src/include/ipxe/efi/efi.h @@ -41,6 +41,16 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define EFIAPI __attribute__((cdecl,regparm(0))) #endif +/* EFI headers define EFI_HANDLE as a void pointer, which renders type + * checking somewhat useless. Work around this bizarre sabotage + * attempt by redefining EFI_HANDLE as a pointer to an anonymous + * structure. + */ +#define EFI_HANDLE STUPID_EFI_HANDLE +#include +#undef EFI_HANDLE +typedef struct {} *EFI_HANDLE; + /* Include the top-level EFI header files */ #include #include