From b1702ff7530d1db571a2aeb59924bef1ff3ce9a2 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Tue, 2 Jul 2019 23:44:59 -0400 Subject: [PATCH] MSVC: Add a few more macro workarounds for missing built-ins This change adds a few more macro to define things that are supposed to be built-in in MSVC. Eventually we might want to move some of those to the parser but it's not clear to me if we want to polute the GCC parser with all of this. Change-Id: I6672d8f14470115aa37a0d76b2b4fb086fe4494f Signed-off-by: Marc-Andre Laperle --- .../cdt/msw/build/WinDiscoveredPathInfo.java | 39 +++++++++++-------- .../cdt/msw/build/core/MSVCToolChain.java | 7 ++++ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java index 90669f42f9e..7c60841b78f 100644 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java +++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java @@ -31,26 +31,33 @@ public class WinDiscoveredPathInfo implements IDiscoveredPathInfo { // Include paths paths = WinEnvironmentVariableSupplier.getIncludePath(); - symbols.put("_M_IX86", "600"); - symbols.put("_WIN32", "1"); - symbols.put("_MSC_VER", "1400"); + symbols.put("_M_IX86", "600"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("_WIN32", "1"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("_MSC_VER", "1400"); //$NON-NLS-1$ //$NON-NLS-2$ // Microsoft specific modifiers that can be ignored - symbols.put("__cdecl", ""); - symbols.put("__fastcall", ""); - symbols.put("__restrict", ""); - symbols.put("__sptr", ""); - symbols.put("__stdcall", ""); - symbols.put("__unaligned", ""); - symbols.put("__uptr", ""); - symbols.put("__w64", ""); + symbols.put("__cdecl", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__fastcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__restrict", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__sptr", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__stdcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__unaligned", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__uptr", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__w64", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__clrcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__thiscall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__vectorcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ // Redefine some things so that the CDT parser can handle them, until there is a VC specific parser - symbols.put("__forceinline", "__inline"); - symbols.put("__int8", "char"); - symbols.put("__int16", "short"); - symbols.put("__int32", "int"); - symbols.put("__int64", "long long"); + symbols.put("__forceinline", "__inline"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__int8", "char"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__int16", "short"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__int32", "int"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__int64", "long long"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__pragma(X)", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__nullptr", "nullptr"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__debugbreak()", "0/0"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__LPREFIX(A)", "L\"##A\""); //$NON-NLS-1$ //$NON-NLS-2$ } @Override diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/core/MSVCToolChain.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/core/MSVCToolChain.java index e912a905284..94647a43cad 100644 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/core/MSVCToolChain.java +++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/core/MSVCToolChain.java @@ -123,6 +123,9 @@ public class MSVCToolChain extends PlatformObject implements IToolChain { symbols.put("__unaligned", ""); //$NON-NLS-1$ //$NON-NLS-2$ symbols.put("__uptr", ""); //$NON-NLS-1$ //$NON-NLS-2$ symbols.put("__w64", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__clrcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__thiscall", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__vectorcall", ""); //$NON-NLS-1$ //$NON-NLS-2$ // Redefine some things so that the CDT parser can handle them, until there is a VC specific parser symbols.put("__forceinline", "__inline"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -130,6 +133,10 @@ public class MSVCToolChain extends PlatformObject implements IToolChain { symbols.put("__int16", "short"); //$NON-NLS-1$ //$NON-NLS-2$ symbols.put("__int32", "int"); //$NON-NLS-1$ //$NON-NLS-2$ symbols.put("__int64", "long long"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__pragma(X)", ""); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__nullptr", "nullptr"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__debugbreak()", "0/0"); //$NON-NLS-1$ //$NON-NLS-2$ + symbols.put("__LPREFIX(A)", "L\"##A\""); //$NON-NLS-1$ //$NON-NLS-2$ } @Override