summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorNate DeSimone <nathaniel.l.desimone@intel.com>2025-04-25 15:54:18 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-04-28 22:59:30 +0000
commitbf99048365a1d1f55268bf77c9c9c12bd396a93b (patch)
tree2e14b8ec7e2f7b0895b415f98f40cb0cde95c176 /BaseTools/Source
parent091bd7958b44d39751a0f3372db14921dd709ed7 (diff)
downloadedk2-bf99048365a1d1f55268bf77c9c9c12bd396a93b.zip
edk2-bf99048365a1d1f55268bf77c9c9c12bd396a93b.tar.gz
edk2-bf99048365a1d1f55268bf77c9c9c12bd396a93b.tar.bz2
BaseTools: Add support for GCC preprocessor line directives
This change adds support for GCC-style preprocessor line directives as documented in: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html On Windows systems, one can use line-markers to see which .vfr file was used to generate a *.i file in the Build directory. This is useful for debugging VFR compilation failures. With this change, the VfrCompiler will not generate compilation errors if the *.i file contains GCC-style line-markers. Without this change, one must disable the pre-processor's emission of line-markers, removing the debug aid they provide. Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g3
1 files changed, 2 insertions, 1 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 55fd067..942e0ed 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -1,7 +1,7 @@
/*++ @file
Vfr Syntax
-Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2025, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
--*/
@@ -111,6 +111,7 @@ VfrParserStart (
#token CloseBracket("]") "\]"
#token LineDefinition "#line\ [0-9]+\ \"~[\"]+\"[\ \t]*\n" << gCVfrErrorHandle.ParseFileScopeRecord (begexpr (), line ()); skip (); newline (); >>
+#token GccLineDefinition "#\ [0-9]+\ \"~[\"]+\"[\ \t]*([1234][\ \t]*)*\n" << gCVfrErrorHandle.ParseFileScopeRecord (begexpr (), line ()); skip (); newline (); >>
#token DevicePath("devicepath") "devicepath"
#token FormSet("formset") "formset"
#token FormSetId("formsetid") "formsetid"