diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index fc5c83463d..b0742969a8 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -534,7 +534,10 @@ UnitTestDebugAssert ( are not included in a module. **/ -#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal +#define DEBUG_CODE_BEGIN() \ + do { \ + if (DebugCodeEnabled ()) { \ + do { } while (FALSE) /** The macro that marks the end of debug source code. @@ -545,7 +548,9 @@ UnitTestDebugAssert ( are not included in a module. **/ -#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE) +#define DEBUG_CODE_END() \ + } \ + } while (FALSE) /** The macro that declares a section of debug source code. diff --git a/MdePkg/Include/Library/PerformanceLib.h b/MdePkg/Include/Library/PerformanceLib.h index d0f2dfb070..40e99d0c4a 100644 --- a/MdePkg/Include/Library/PerformanceLib.h +++ b/MdePkg/Include/Library/PerformanceLib.h @@ -734,7 +734,10 @@ LogPerformanceMeasurement ( Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module. **/ -#define PERF_CODE_BEGIN() do { if (PerformanceMeasurementEnabled ()) { UINT8 __PerformanceCodeLocal +#define PERF_CODE_BEGIN() \ + do { \ + if (PerformanceMeasurementEnabled ()) { \ + do { } while (FALSE) /** Macro that marks the end of performance measurement source code. @@ -744,7 +747,9 @@ LogPerformanceMeasurement ( Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module. **/ -#define PERF_CODE_END() __PerformanceCodeLocal = 0; __PerformanceCodeLocal++; } } while (FALSE) +#define PERF_CODE_END() \ + } \ + } while (FALSE) /** Macro that declares a section of performance measurement source code.