diff options
author | Marc-Andre Laperle | 2019-09-29 03:02:05 +0000 |
---|---|---|
committer | Marc-André Laperle | 2019-10-04 03:14:32 +0000 |
commit | 4e16631f30de08444342b0ad6622cfcf3cd39fd4 (patch) | |
tree | 2e8f4cbb89441d717d93021b2cba5e65d87de9ba /lrparser/org.eclipse.cdt.core.lrparser | |
parent | 232e3d71536134a8fe722f133a8af7d785345790 (diff) | |
download | org.eclipse.cdt-4e16631f30de08444342b0ad6622cfcf3cd39fd4.tar.gz org.eclipse.cdt-4e16631f30de08444342b0ad6622cfcf3cd39fd4.tar.xz org.eclipse.cdt-4e16631f30de08444342b0ad6622cfcf3cd39fd4.zip |
Bug 360919 - [MSVC] preprocessor symbol __STDC__ always defined
Move the __STDC__ macro to the scanner configuration extension, where we can
differentiate compiler type. Only add it when compiler type is not MSVC.
This will miss the case where MSVC is compiling in C mode and /Za is used,
then __STDC__ should be defined but this is a much less common case and would be
addressed likely outside scanner configuration.
See also
https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
Change-Id: Icc5d3ef038fb468efe33802a04fc78fc1e5e583e
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'lrparser/org.eclipse.cdt.core.lrparser')
-rw-r--r-- | lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java index 29d8c40e8d6..f7d2b076892 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java +++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java @@ -24,6 +24,7 @@ import org.eclipse.cdt.core.dom.parser.AbstractScannerExtensionConfiguration; public class ScannerExtensionConfiguration extends AbstractScannerExtensionConfiguration { private ScannerExtensionConfiguration() { + addMacro("__STDC__", "1"); } public static ScannerExtensionConfiguration createC() { |