Browse Source

Fix the build.

pull/13/merge
triton 13 years ago
parent
commit
0a7656e257
  1. 2
      src/Generator/AST/Utils.cs
  2. 6
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  3. 8
      src/Generator/Generators/CLI/CLISourcesTemplate.cs
  4. 14
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  5. 5
      src/Generator/Passes/CheckAmbiguousOverloads.cs

2
src/Generator/AST/Utils.cs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

namespace CppSharp.AST
{
public static class Utils
public static class ASTUtils
{
public static bool CheckIgnoreFunction(Class @class, Function function)
{

6
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -364,7 +364,7 @@ namespace CppSharp.Generators.CLI @@ -364,7 +364,7 @@ namespace CppSharp.Generators.CLI
PushIndent();
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field)) continue;
if (ASTUtils.CheckIgnoreField(@class, field)) continue;
GenerateDeclarationCommon(field);
if (@class.IsUnion)
@ -421,7 +421,7 @@ namespace CppSharp.Generators.CLI @@ -421,7 +421,7 @@ namespace CppSharp.Generators.CLI
var staticMethods = new List<Method>();
foreach (var method in @class.Methods)
{
if (Utils.CheckIgnoreMethod(@class, method))
if (ASTUtils.CheckIgnoreMethod(@class, method))
continue;
if (method.IsConstructor)
@ -499,7 +499,7 @@ namespace CppSharp.Generators.CLI @@ -499,7 +499,7 @@ namespace CppSharp.Generators.CLI
PushIndent();
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field))
if (ASTUtils.CheckIgnoreField(@class, field))
continue;
GenerateDeclarationCommon(field);

8
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -143,7 +143,7 @@ namespace CppSharp.Generators.CLI @@ -143,7 +143,7 @@ namespace CppSharp.Generators.CLI
foreach (var method in @class.Methods)
{
if (Utils.CheckIgnoreMethod(@class, method))
if (ASTUtils.CheckIgnoreMethod(@class, method))
continue;
GenerateDeclarationCommon(method);
@ -156,7 +156,7 @@ namespace CppSharp.Generators.CLI @@ -156,7 +156,7 @@ namespace CppSharp.Generators.CLI
{
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field))
if (ASTUtils.CheckIgnoreField(@class, field))
continue;
GenerateFieldProperty(field);
@ -482,7 +482,7 @@ namespace CppSharp.Generators.CLI @@ -482,7 +482,7 @@ namespace CppSharp.Generators.CLI
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field)) continue;
if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var nativeField = string.Format("{0}{1}",
nativeVar, field.OriginalName);
@ -612,7 +612,7 @@ namespace CppSharp.Generators.CLI @@ -612,7 +612,7 @@ namespace CppSharp.Generators.CLI
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field)) continue;
if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var varName = string.Format("_native.{0}", field.OriginalName);

14
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -346,7 +346,7 @@ namespace CppSharp.Generators.CSharp @@ -346,7 +346,7 @@ namespace CppSharp.Generators.CSharp
foreach (var method in @class.Methods)
{
if (Utils.CheckIgnoreMethod(@class, method))
if (ASTUtils.CheckIgnoreMethod(@class, method))
continue;
if (method.IsConstructor)
@ -404,7 +404,7 @@ namespace CppSharp.Generators.CSharp @@ -404,7 +404,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field)) continue;
if (ASTUtils.CheckIgnoreField(@class, field)) continue;
var nativeField = string.Format("{0}->{1}",
Helpers.GeneratedIdentifier("ptr"), field.OriginalName);
@ -554,7 +554,7 @@ namespace CppSharp.Generators.CSharp @@ -554,7 +554,7 @@ namespace CppSharp.Generators.CSharp
foreach (var field in @class.Fields)
{
if (Utils.CheckIgnoreField(@class, field)) continue;
if (ASTUtils.CheckIgnoreField(@class, field)) continue;
NewLineIfNeeded();
@ -751,7 +751,7 @@ namespace CppSharp.Generators.CSharp @@ -751,7 +751,7 @@ namespace CppSharp.Generators.CSharp
var staticMethods = new List<Method>();
foreach (var method in @class.Methods)
{
if (Utils.CheckIgnoreMethod(@class, method))
if (ASTUtils.CheckIgnoreMethod(@class, method))
continue;
if (method.IsConstructor)
@ -842,7 +842,7 @@ namespace CppSharp.Generators.CSharp @@ -842,7 +842,7 @@ namespace CppSharp.Generators.CSharp
var args = TypePrinter.VisitParameters(@event.Parameters, hasNames: true);
TypePrinter.PopContext();
delegateInstance = Helpers.GeneratedIdentifier(@event.Name);
delegateInstance = Helpers.GeneratedIdentifier(@event.OriginalName);
delegateName = delegateInstance + "Delegate";
delegateRaise = delegateInstance + "RaiseInstance";
@ -949,7 +949,7 @@ namespace CppSharp.Generators.CSharp @@ -949,7 +949,7 @@ namespace CppSharp.Generators.CSharp
foreach (var ctor in @class.Constructors)
{
if (Utils.CheckIgnoreMethod(@class, ctor))
if (ASTUtils.CheckIgnoreMethod(@class, ctor))
continue;
NewLineIfNeeded();
@ -1759,7 +1759,7 @@ namespace CppSharp.Generators.CSharp @@ -1759,7 +1759,7 @@ namespace CppSharp.Generators.CSharp
retType = "System.IntPtr";
}
for(var i = 0; i < function.Parameters.Count; ++i)
for (var i = 0; i < function.Parameters.Count; ++i)
{
var param = function.Parameters[i];

5
src/Generator/Passes/CheckAmbiguousOverloads.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CppSharp.AST;
using CppSharp.Generators;
namespace CppSharp.Passes
@ -30,10 +31,10 @@ namespace CppSharp.Passes @@ -30,10 +31,10 @@ namespace CppSharp.Passes
if (overload1.Function == overload2.Function)
return false;
if (AST.Utils.CheckIgnoreFunction(@class, overload1.Function))
if (ASTUtils.CheckIgnoreFunction(@class, overload1.Function))
return false;
if (AST.Utils.CheckIgnoreFunction(@class, overload2.Function))
if (ASTUtils.CheckIgnoreFunction(@class, overload2.Function))
return false;
// TODO: Default parameters?

Loading…
Cancel
Save