Browse Source

Misc changes/fixes

pull/1926/head
duckdoom5 4 months ago
parent
commit
6f5a46d7c3
  1. 5
      src/Core/Diagnostics.cs
  2. 2
      src/CppParser/Bootstrap/StmtCodeGenerators.cs
  3. 3
      src/Generator/Types/Std/Stdlib.CSharp.cs
  4. 3
      tests/dotnet/Common/Common.h

5
src/Core/Diagnostics.cs

@ -128,7 +128,10 @@ namespace CppSharp
{ {
Console.WriteLine(message); 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) public void PushIndent(int level)

2
src/CppParser/Bootstrap/StmtCodeGenerators.cs

@ -344,7 +344,7 @@ namespace CppSharp
{ {
var expr = $"_S->{fieldName} = static_cast<AST::{typeName}>(WalkExpression(S->{methodName}()));"; 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 // Clang asserts that 'getBase()' is not called when 'isImplicitAccess()' returns true
WriteLine("if (!S->isImplicitAccess())"); WriteLine("if (!S->isImplicitAccess())");

3
src/Generator/Types/Std/Stdlib.CSharp.cs

@ -307,10 +307,13 @@ namespace CppSharp.Types.Std.CSharp
{ {
if (ctx.Kind == TypePrinterContextKind.Managed) if (ctx.Kind == TypePrinterContextKind.Managed)
return new CILType(typeof(string)); return new CILType(typeof(string));
var typePrinter = new CSharpTypePrinter(null); var typePrinter = new CSharpTypePrinter(null);
typePrinter.PushContext(TypePrinterContextKind.Native); typePrinter.PushContext(TypePrinterContextKind.Native);
if (ctx.Type.Desugar().IsAddress()) if (ctx.Type.Desugar().IsAddress())
return new CustomType(typePrinter.IntPtrType); return new CustomType(typePrinter.IntPtrType);
ClassTemplateSpecialization basicString = GetBasicString(ctx.Type); ClassTemplateSpecialization basicString = GetBasicString(ctx.Type);
return new CustomType(basicString.Visit(typePrinter).Type); return new CustomType(basicString.Visit(typePrinter).Type);
} }

3
tests/dotnet/Common/Common.h

@ -1,4 +1,5 @@
#include "../Tests.h" #pragma once
#include "../Tests.h"
#include "AnotherUnit.h" #include "AnotherUnit.h"
#ifdef _WIN32 #ifdef _WIN32

Loading…
Cancel
Save