From fe56198ceb36e1e56724ad5fd353c63e0ff8f031 Mon Sep 17 00:00:00 2001 From: triton Date: Sun, 26 Oct 2014 01:49:14 +0100 Subject: [PATCH] Fixed ToolSetToUse to work with the latest Clang expectations. --- src/Generator/Driver.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index bd16c0d7..c015f2e6 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -1,6 +1,7 @@ using System; using System.CodeDom.Compiler; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -133,6 +134,15 @@ namespace CppSharp LanguageVersion = Options.LanguageVersion }; + // This eventually gets passed to Clang's MSCompatibilityVersion, which + // is in turn used to derive the value of the built-in define _MSC_VER. + // It used to receive a 4-digit based identifier but now expects a full + // version MSVC digit, so check if we still have the old version and + // convert to the right format. + + if (Options.ToolSetToUse.ToString(CultureInfo.InvariantCulture).Length == 4) + Options.ToolSetToUse *= 100000; + for (uint i = 0; i < Options.ArgumentsCount; ++i) { var arg = Options.getArguments(i);