From e6797413058281e76caed111fa4a90090f876bb6 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 3 Feb 2026 13:22:31 -0500 Subject: [PATCH] EmulatorPkg: Replace include guards with #pragma once Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki --- EmulatorPkg/CpuRuntimeDxe/CpuDriver.h | 5 +---- EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.h | 5 +---- EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.h | 5 +---- EmulatorPkg/EmuGopDxe/Gop.h | 5 +---- EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.h | 5 +---- EmulatorPkg/EmuSnpDxe/EmuSnpDxe.h | 5 +---- EmulatorPkg/FvbServicesRuntimeDxe/FwBlockService.h | 5 +---- EmulatorPkg/Include/Guid/EmuPhysicalDisk.h | 5 +---- EmulatorPkg/Include/Guid/EmuSystemConfig.h | 5 +---- EmulatorPkg/Include/Guid/EmuVirtualDisk.h | 5 +---- EmulatorPkg/Include/Library/EmuMagicPageLib.h | 5 +---- EmulatorPkg/Include/Library/EmuThunkLib.h | 5 +---- EmulatorPkg/Include/Library/PpiListLib.h | 5 +---- EmulatorPkg/Include/Library/SmbiosLib.h | 5 +---- EmulatorPkg/Include/Ppi/EmuThunk.h | 5 +---- EmulatorPkg/Include/Protocol/EmuBlockIo.h | 5 +---- EmulatorPkg/Include/Protocol/EmuFileSystem.h | 5 +---- EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h | 5 +---- EmulatorPkg/Include/Protocol/EmuIoThunk.h | 5 +---- EmulatorPkg/Include/Protocol/EmuSnp.h | 5 +---- EmulatorPkg/Include/Protocol/EmuThread.h | 5 +---- EmulatorPkg/Include/Protocol/EmuThunk.h | 5 +---- EmulatorPkg/Library/PlatformBmLib/PlatformBm.h | 5 +---- EmulatorPkg/Sec/Sec.h | 5 +---- EmulatorPkg/TimerDxe/Timer.h | 5 +---- EmulatorPkg/Unix/Host/Gasket.h | 5 +---- EmulatorPkg/Unix/Host/Host.h | 5 +---- EmulatorPkg/Win/Host/WinGop.h | 5 +---- EmulatorPkg/Win/Host/WinHost.h | 5 +---- EmulatorPkg/Win/Host/WinInclude.h | 5 +---- 30 files changed, 30 insertions(+), 120 deletions(-) diff --git a/EmulatorPkg/CpuRuntimeDxe/CpuDriver.h b/EmulatorPkg/CpuRuntimeDxe/CpuDriver.h index cec82a1b6f..c704522605 100644 --- a/EmulatorPkg/CpuRuntimeDxe/CpuDriver.h +++ b/EmulatorPkg/CpuRuntimeDxe/CpuDriver.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_ -#define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_ +#pragma once #include #include @@ -219,5 +218,3 @@ CpuMpServicesWhoAmI ( ); extern EFI_MP_SERVICES_PROTOCOL mMpServicesTemplate; - -#endif diff --git a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.h b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.h index ac7d8356fa..a8142569ee 100644 --- a/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.h +++ b/EmulatorPkg/EmuBlockIoDxe/EmuBlockIo.h @@ -18,8 +18,7 @@ Abstract: **/ -#ifndef _EMU_BLOCK_IO_H_ -#define _EMU_BLOCK_IO_H_ +#pragma once #include #include @@ -71,5 +70,3 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gEmuBlockIoComponentName2; extern EFI_DRIVER_CONFIGURATION_PROTOCOL gEmuBlockIoDriverConfiguration; extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gEmuBlockIoDriverDiagnostics; extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gEmuBlockIoDriverDiagnostics2; - -#endif diff --git a/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.h b/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.h index b9617a0bfa..afe199ca1d 100644 --- a/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.h +++ b/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_BUS_DRIVER_H__ -#define __EMU_BUS_DRIVER_H__ +#pragma once #include @@ -99,5 +98,3 @@ EmuBusCreateDevicePath ( IN EFI_GUID *Guid, IN UINT16 InstanceNumber ); - -#endif diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h index e7c5ecf417..d0a532b0b0 100644 --- a/EmulatorPkg/EmuGopDxe/Gop.h +++ b/EmulatorPkg/EmuGopDxe/Gop.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __GOP_H_ -#define __GOP_H_ +#pragma once #include @@ -176,5 +175,3 @@ GopPrivateBreakCallbackFunction ( IN VOID *Context, IN EFI_KEY_DATA *KeyData ); - -#endif diff --git a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.h b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.h index 61964137a4..9043a9131b 100644 --- a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.h +++ b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _EMU_SIMPLE_FILE_SYSTEM_H_ -#define _EMU_SIMPLE_FILE_SYSTEM_H_ +#pragma once #include "PiDxe.h" @@ -67,5 +66,3 @@ typedef struct { EfiFile, \ EMU_EFI_FILE_PRIVATE_SIGNATURE \ ) - -#endif diff --git a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.h b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.h index 2d66eb748e..fc33a3dab2 100644 --- a/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.h +++ b/EmulatorPkg/EmuSnpDxe/EmuSnpDxe.h @@ -12,8 +12,7 @@ Abstract: -**/ -#ifndef _EMU_SNP_H_ -#define _EMU_SNP_H_ +#pragma once #include @@ -476,5 +475,3 @@ EmuSnpWaitForPacketNotify ( IN EFI_EVENT Event, IN VOID *Private ); - -#endif // _EMU_SNP_H_ diff --git a/EmulatorPkg/FvbServicesRuntimeDxe/FwBlockService.h b/EmulatorPkg/FvbServicesRuntimeDxe/FwBlockService.h index 4278210c1d..922eebe286 100644 --- a/EmulatorPkg/FvbServicesRuntimeDxe/FwBlockService.h +++ b/EmulatorPkg/FvbServicesRuntimeDxe/FwBlockService.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _FW_BLOCK_SERVICE_H -#define _FW_BLOCK_SERVICE_H +#pragma once // // BugBug: Add documentation here for data structure!!!! @@ -208,5 +207,3 @@ FvbProtocolEraseBlocks ( ... ) ; - -#endif diff --git a/EmulatorPkg/Include/Guid/EmuPhysicalDisk.h b/EmulatorPkg/Include/Guid/EmuPhysicalDisk.h index e1be4d200e..8738f24f02 100644 --- a/EmulatorPkg/Include/Guid/EmuPhysicalDisk.h +++ b/EmulatorPkg/Include/Guid/EmuPhysicalDisk.h @@ -7,12 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_PHYSICAL_DISK_H__ -#define __EMU_PHYSICAL_DISK_H__ +#pragma once #define EFI_EMU_PHYSICAL_DISK_GUID \ { 0xf2ba331a, 0x8985, 0x11db, { 0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } } extern EFI_GUID gEmuPhysicalDisksGuid; - -#endif diff --git a/EmulatorPkg/Include/Guid/EmuSystemConfig.h b/EmulatorPkg/Include/Guid/EmuSystemConfig.h index e448220740..0b3da77e6e 100644 --- a/EmulatorPkg/Include/Guid/EmuSystemConfig.h +++ b/EmulatorPkg/Include/Guid/EmuSystemConfig.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_SYSTEM_CONFIG_H__ -#define __EMU_SYSTEM_CONFIG_H__ +#pragma once #define EFI_EMU_SYSTEM_CONFIG_GUID \ { 0x9C4FB516, 0x3A1E, 0xD847, { 0xA1, 0xA1, 0x70, 0x58, 0xB6, 0x98, 0x67, 0x32 } } @@ -24,5 +23,3 @@ typedef struct { #pragma pack() extern EFI_GUID gEmuSystemConfigGuid; - -#endif diff --git a/EmulatorPkg/Include/Guid/EmuVirtualDisk.h b/EmulatorPkg/Include/Guid/EmuVirtualDisk.h index 66fc95f65f..ef7e82dfc3 100644 --- a/EmulatorPkg/Include/Guid/EmuVirtualDisk.h +++ b/EmulatorPkg/Include/Guid/EmuVirtualDisk.h @@ -7,12 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_VIRTUAL_DISK_H__ -#define __EMU_VIRTUAL_DISK_H__ +#pragma once #define EFI_EMU_VIRTUAL_DISK_GUID \ { 0xf2ba331a, 0x8985, 0x11db, { 0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } } extern EFI_GUID gEmuVirtualDisksGuid; - -#endif diff --git a/EmulatorPkg/Include/Library/EmuMagicPageLib.h b/EmulatorPkg/Include/Library/EmuMagicPageLib.h index d102f1666a..c697f30a4f 100644 --- a/EmulatorPkg/Include/Library/EmuMagicPageLib.h +++ b/EmulatorPkg/Include/Library/EmuMagicPageLib.h @@ -8,8 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_MAGIC_PAGE_LIB_H__ -#define __EMU_MAGIC_PAGE_LIB_H__ +#pragma once #include #include @@ -28,5 +27,3 @@ typedef struct { } EMU_MAGIC_PAGE_LAYOUT; #define EMU_MAGIC_PAGE() ((EMU_MAGIC_PAGE_LAYOUT *)((UINTN)PcdGet64 (PcdPeiServicesTablePage))) - -#endif diff --git a/EmulatorPkg/Include/Library/EmuThunkLib.h b/EmulatorPkg/Include/Library/EmuThunkLib.h index 54bd7e65cd..2b4617729d 100644 --- a/EmulatorPkg/Include/Library/EmuThunkLib.h +++ b/EmulatorPkg/Include/Library/EmuThunkLib.h @@ -5,8 +5,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_THUNK_LIB_H__ -#define __EMU_THUNK_LIB_H__ +#pragma once #include @@ -29,5 +28,3 @@ GetIoThunkInstance ( IN EFI_GUID *Protocol, IN UINTN Instance ); - -#endif diff --git a/EmulatorPkg/Include/Library/PpiListLib.h b/EmulatorPkg/Include/Library/PpiListLib.h index a538cfde12..0bc4fd019e 100644 --- a/EmulatorPkg/Include/Library/PpiListLib.h +++ b/EmulatorPkg/Include/Library/PpiListLib.h @@ -5,9 +5,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PPI_LIST_LIB_H__ -#define __PPI_LIST_LIB_H__ +#pragma once extern CONST EFI_PEI_PPI_DESCRIPTOR *gPpiList; - -#endif diff --git a/EmulatorPkg/Include/Library/SmbiosLib.h b/EmulatorPkg/Include/Library/SmbiosLib.h index aeba2f908e..8f7cbff72f 100644 --- a/EmulatorPkg/Include/Library/SmbiosLib.h +++ b/EmulatorPkg/Include/Library/SmbiosLib.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _SMBIOS_LIB_H__ -#define _SMBIOS_LIB_H__ +#pragma once #include #include @@ -182,5 +181,3 @@ EFIAPI SmbiosLibRemove ( OUT EFI_SMBIOS_HANDLE SmbiosHandle ); - -#endif diff --git a/EmulatorPkg/Include/Ppi/EmuThunk.h b/EmulatorPkg/Include/Ppi/EmuThunk.h index c78ad692ed..4b0207a5db 100644 --- a/EmulatorPkg/Include/Ppi/EmuThunk.h +++ b/EmulatorPkg/Include/Ppi/EmuThunk.h @@ -7,8 +7,7 @@ **/ -#ifndef __EMU_THUNK_PPI_H__ -#define __EMU_THUNK_PPI_H__ +#pragma once #define EMU_THUNK_PPI_GUID \ { 0xB958B78C, 0x1D3E, 0xEE40, { 0x8B, 0xF4, 0xF0, 0x63, 0x2D, 0x06, 0x39, 0x16 } } @@ -115,5 +114,3 @@ typedef struct { } EMU_THUNK_PPI; extern EFI_GUID gEmuThunkPpiGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuBlockIo.h b/EmulatorPkg/Include/Protocol/EmuBlockIo.h index 494e100e74..c3768f002b 100644 --- a/EmulatorPkg/Include/Protocol/EmuBlockIo.h +++ b/EmulatorPkg/Include/Protocol/EmuBlockIo.h @@ -10,8 +10,7 @@ **/ -#ifndef __EMU_BLOCK_IO_H__ -#define __EMU_BLOCK_IO_H__ +#pragma once #include #include @@ -177,5 +176,3 @@ struct _EMU_BLOCK_IO_PROTOCOL { }; extern EFI_GUID gEmuBlockIoProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h b/EmulatorPkg/Include/Protocol/EmuFileSystem.h index 90c075e8a6..0a4546e102 100644 --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h @@ -13,8 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _EMU_GRAPHICS_WINDOW_H_ -#define _EMU_GRAPHICS_WINDOW_H_ +#pragma once #include #include @@ -127,5 +126,3 @@ struct _EMU_GRAPHICS_WINDOW_PROTOCOL { }; extern EFI_GUID gEmuGraphicsWindowProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h index 68b2098d31..39a5496a72 100644 --- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h +++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _EMU_GRAPHICS_WINDOW_H_ -#define _EMU_GRAPHICS_WINDOW_H_ +#pragma once #include #include @@ -121,5 +120,3 @@ struct _EMU_GRAPHICS_WINDOW_PROTOCOL { }; extern EFI_GUID gEmuGraphicsWindowProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuIoThunk.h b/EmulatorPkg/Include/Protocol/EmuIoThunk.h index b6da635177..ef3aead07e 100644 --- a/EmulatorPkg/Include/Protocol/EmuIoThunk.h +++ b/EmulatorPkg/Include/Protocol/EmuIoThunk.h @@ -7,8 +7,7 @@ **/ -#ifndef __EMU_IO_THUNK__ -#define __EMU_IO_THUNK__ +#pragma once #define EMU_IO_THUNK_PROTOCO_GUID \ { 0x453368F6, 0x7C85, 0x434A, { 0xA9, 0x8A, 0x72, 0xD1, 0xB7, 0xFF, 0xA9, 0x26 } } @@ -38,5 +37,3 @@ struct _EMU_IO_THUNK_PROTOCOL { }; extern EFI_GUID gEmuIoThunkProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuSnp.h b/EmulatorPkg/Include/Protocol/EmuSnp.h index b461a1cb38..b167c35d7d 100644 --- a/EmulatorPkg/Include/Protocol/EmuSnp.h +++ b/EmulatorPkg/Include/Protocol/EmuSnp.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EMU_SNP_H__ -#define __EMU_SNP_H__ +#pragma once #include @@ -447,5 +446,3 @@ struct _EMU_SNP_PROTOCOL { }; extern EFI_GUID gEmuSnpProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuThread.h b/EmulatorPkg/Include/Protocol/EmuThread.h index fbde40bb4c..5dc293fb77 100644 --- a/EmulatorPkg/Include/Protocol/EmuThread.h +++ b/EmulatorPkg/Include/Protocol/EmuThread.h @@ -8,8 +8,7 @@ **/ -#ifndef __EMU_THREAD_THUNK__ -#define __EMU_THREAD_THUNK__ +#pragma once typedef struct _EMU_THREAD_THUNK_PROTOCOL EMU_THREAD_THUNK_PROTOCOL; @@ -82,5 +81,3 @@ struct _EMU_THREAD_THUNK_PROTOCOL { }; extern EFI_GUID gEmuThreadThunkProtocolGuid; - -#endif diff --git a/EmulatorPkg/Include/Protocol/EmuThunk.h b/EmulatorPkg/Include/Protocol/EmuThunk.h index bdd57f410b..61c0279f41 100644 --- a/EmulatorPkg/Include/Protocol/EmuThunk.h +++ b/EmulatorPkg/Include/Protocol/EmuThunk.h @@ -8,8 +8,7 @@ **/ -#ifndef __EMU_THUNK_PROTOCOL_H__ -#define __EMU_THUNK_PROTOCOL_H__ +#pragma once #define EMU_THUNK_PROTOCOL_GUID \ { 0x5CF32E0B, 0x8EDF, 0x2E44, { 0x9C, 0xDA, 0x93, 0x20, 0x5E, 0x99, 0xEC, 0x1C } } @@ -243,5 +242,3 @@ struct _EMU_THUNK_PROTOCOL { }; extern EFI_GUID gEmuThunkProtocolGuid; - -#endif diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h index 01fc45f22a..d2a9fdadd1 100644 --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _PLATFORM_BM_H -#define _PLATFORM_BM_H +#pragma once #include @@ -85,5 +84,3 @@ VOID PlatformBdsConnectSequence ( VOID ); - -#endif // _PLATFORM_BM_H diff --git a/EmulatorPkg/Sec/Sec.h b/EmulatorPkg/Sec/Sec.h index 94689eb41d..8ccfcb4f7d 100644 --- a/EmulatorPkg/Sec/Sec.h +++ b/EmulatorPkg/Sec/Sec.h @@ -8,8 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __SEC_H___ -#define __SEC_H___ +#pragma once #include #include @@ -28,5 +27,3 @@ SecTemporaryRamSupport ( IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, IN UINTN CopySize ); - -#endif diff --git a/EmulatorPkg/TimerDxe/Timer.h b/EmulatorPkg/TimerDxe/Timer.h index 7a995e0d96..25d3405b92 100644 --- a/EmulatorPkg/TimerDxe/Timer.h +++ b/EmulatorPkg/TimerDxe/Timer.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _TIMER_H_ -#define _TIMER_H_ +#pragma once // // Legal timer value range in 100 ns units @@ -60,5 +59,3 @@ EFIAPI EmuTimerDriverGenerateSoftInterrupt ( IN EFI_TIMER_ARCH_PROTOCOL *This ); - -#endif diff --git a/EmulatorPkg/Unix/Host/Gasket.h b/EmulatorPkg/Unix/Host/Gasket.h index 65b2c72965..31c3602714 100644 --- a/EmulatorPkg/Unix/Host/Gasket.h +++ b/EmulatorPkg/Unix/Host/Gasket.h @@ -7,8 +7,7 @@ **/ -#ifndef _GASKET_H_ -#define _GASKET_H_ +#pragma once // // EMU_THUNK_PROTOCOL gaskets (EFIAPI to UNIX ABI) @@ -621,5 +620,3 @@ GasketSnpReceive ( OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL ); - -#endif diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h index f46445a713..bc4050d42d 100644 --- a/EmulatorPkg/Unix/Host/Host.h +++ b/EmulatorPkg/Unix/Host/Host.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _SEC_MAIN_H__ -#define _SEC_MAIN_H__ +#pragma once // // Name mangle to prevent build errors. I.e conflicts between EFI and OS @@ -354,5 +353,3 @@ extern EMU_IO_THUNK_PROTOCOL gPosixFileSystemThunkIo; extern EMU_IO_THUNK_PROTOCOL gPthreadThunkIo; extern EMU_IO_THUNK_PROTOCOL gBlockIoThunkIo; extern EMU_IO_THUNK_PROTOCOL gSnpThunkIo; - -#endif diff --git a/EmulatorPkg/Win/Host/WinGop.h b/EmulatorPkg/Win/Host/WinGop.h index 2799778ca9..6cb7d3332e 100644 --- a/EmulatorPkg/Win/Host/WinGop.h +++ b/EmulatorPkg/Win/Host/WinGop.h @@ -14,8 +14,7 @@ Abstract: **/ -#ifndef _WIN_GOP_H_ -#define _WIN_GOP_H_ +#pragma once #include "WinHost.h" @@ -197,5 +196,3 @@ GopPrivateDestroyQ ( IN GRAPHICS_PRIVATE_DATA *Private, IN GOP_QUEUE_FIXED *Queue ); - -#endif diff --git a/EmulatorPkg/Win/Host/WinHost.h b/EmulatorPkg/Win/Host/WinHost.h index a9a21007e3..6d81ae7672 100644 --- a/EmulatorPkg/Win/Host/WinHost.h +++ b/EmulatorPkg/Win/Host/WinHost.h @@ -13,8 +13,7 @@ Abstract: **/ -#ifndef _HOST_H_ -#define _HOST_H_ +#pragma once #include #include @@ -211,5 +210,3 @@ extern EMU_IO_THUNK_PROTOCOL mWinNtWndThunkIo; extern EMU_IO_THUNK_PROTOCOL mWinNtFileSystemThunkIo; extern EMU_IO_THUNK_PROTOCOL mWinNtBlockIoThunkIo; extern EMU_IO_THUNK_PROTOCOL mWinNtSnpThunkIo; - -#endif diff --git a/EmulatorPkg/Win/Host/WinInclude.h b/EmulatorPkg/Win/Host/WinInclude.h index 76bc3acde9..be10a2ed39 100644 --- a/EmulatorPkg/Win/Host/WinInclude.h +++ b/EmulatorPkg/Win/Host/WinInclude.h @@ -5,8 +5,7 @@ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __WIN_NT_INCLUDE_H__ -#define __WIN_NT_INCLUDE_H__ +#pragma once #undef VOID @@ -46,5 +45,3 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define IMAGE_FILE_MACHINE_ARM64 0xAA64 #endif #endif - -#endif