diff --git a/src/Core/Diagnostics.cs b/src/Core/Diagnostics.cs index a7f40ac6..c10733ab 100644 --- a/src/Core/Diagnostics.cs +++ b/src/Core/Diagnostics.cs @@ -128,7 +128,10 @@ namespace CppSharp { Console.WriteLine(message); } - Debug.WriteLine(message); + + // Don't output debug messages to VS output window. This is extremely slow. + if (info.Kind > DiagnosticKind.Debug) + Debug.WriteLine(message); } public void PushIndent(int level) diff --git a/src/CppParser/Bootstrap/StmtCodeGenerators.cs b/src/CppParser/Bootstrap/StmtCodeGenerators.cs index fef1a24e..faaf2ef2 100644 --- a/src/CppParser/Bootstrap/StmtCodeGenerators.cs +++ b/src/CppParser/Bootstrap/StmtCodeGenerators.cs @@ -344,7 +344,7 @@ namespace CppSharp { var expr = $"_S->{fieldName} = static_cast<AST::{typeName}>(WalkExpression(S->{methodName}()));"; - if (fieldName == "base" && typeName is "CXXDependentScopeMemberExpr") + if (fieldName == "base" && @class.Name == "CXXDependentScopeMemberExpr") { // Clang asserts that 'getBase()' is not called when 'isImplicitAccess()' returns true WriteLine("if (!S->isImplicitAccess())"); diff --git a/src/Generator/Types/Std/Stdlib.CSharp.cs b/src/Generator/Types/Std/Stdlib.CSharp.cs index 6673604a..30dd436b 100644 --- a/src/Generator/Types/Std/Stdlib.CSharp.cs +++ b/src/Generator/Types/Std/Stdlib.CSharp.cs @@ -307,10 +307,13 @@ namespace CppSharp.Types.Std.CSharp { if (ctx.Kind == TypePrinterContextKind.Managed) return new CILType(typeof(string)); + var typePrinter = new CSharpTypePrinter(null); typePrinter.PushContext(TypePrinterContextKind.Native); + if (ctx.Type.Desugar().IsAddress()) return new CustomType(typePrinter.IntPtrType); + ClassTemplateSpecialization basicString = GetBasicString(ctx.Type); return new CustomType(basicString.Visit(typePrinter).Type); } diff --git a/tests/dotnet/Common/Common.h b/tests/dotnet/Common/Common.h index 2bb28256..322491bb 100644 --- a/tests/dotnet/Common/Common.h +++ b/tests/dotnet/Common/Common.h @@ -1,4 +1,5 @@ -#include "../Tests.h" +#pragma once +#include "../Tests.h" #include "AnotherUnit.h" #ifdef _WIN32