diff options
author | Michael Brown <mcb30@ipxe.org> | 2014-07-31 12:17:59 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2014-07-31 12:17:59 +0100 |
commit | 88bd71a27abb658a2ac12b54ed78c5cfd4c99f53 (patch) | |
tree | 775b2cd4a7d36ce3c0bb3526211ca6e6651b71f7 | |
parent | 60891f699ae268ef6ca425013b2427769a5f5fc2 (diff) | |
download | ipxe-88bd71a27abb658a2ac12b54ed78c5cfd4c99f53.zip ipxe-88bd71a27abb658a2ac12b54ed78c5cfd4c99f53.tar.gz ipxe-88bd71a27abb658a2ac12b54ed78c5cfd4c99f53.tar.bz2 |
[efi] Allow compiler to perform type checks on EFI_HANDLE
The EFI headers define EFI_HANDLE as a void pointer, which renders
type checking on anything dealing with EFI handles somewhat useless.
Work around this bizarre sabotage attempt by redefining EFI_HANDLE as
a pointer to an anonymous structure.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/include/ipxe/efi/efi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h index 0e02963..a1ba496 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 <ipxe/efi/Uefi/UefiBaseType.h> +#undef EFI_HANDLE +typedef struct {} *EFI_HANDLE; + /* Include the top-level EFI header files */ #include <ipxe/efi/Uefi.h> #include <ipxe/efi/PiDxe.h> |