From 4e16631f30de08444342b0ad6622cfcf3cd39fd4 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Sat, 28 Sep 2019 23:02:05 -0400 Subject: 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 --- .../org/eclipse/cdt/core/dom/lrparser/ScannerExtensionConfiguration.java | 1 + 1 file changed, 1 insertion(+) (limited to 'lrparser') 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() { -- cgit v1.2.3