david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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>
This commit is contained in:
Michael Brown 2014-07-31 12:17:59 +01:00
parent 60891f699a
commit 88bd71a27a
1 changed files with 10 additions and 0 deletions

View File

@ -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>