Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Generator/Generators/C/CppHeaders.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CppSharp.AST;
using CppSharp.AST.Extensions;
Expand Down Expand Up @@ -87,7 +88,8 @@ public void GenerateIncludeForwardRefs(TranslationUnit unit)
if (typeRef.Include.TranslationUnit == unit)
continue;

if (typeRef.Include.File == unit.FileName)
var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName;
if (typeRef.Include.File == filename)
continue;

var include = typeRef.Include;
Expand Down
3 changes: 2 additions & 1 deletion src/Generator/Generators/C/CppSources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public virtual void GenerateForwardReferenceHeaders(TranslationUnit unit)

foreach (var typeRef in typeReferenceCollector.TypeReferences)
{
if (typeRef.Include.File == unit.FileName)
var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName;
if (typeRef.Include.File == filename)
continue;

var include = typeRef.Include;
Expand Down
4 changes: 3 additions & 1 deletion src/Generator/Generators/CLI/CLIHeaders.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CppSharp.AST;
using CppSharp.AST.Extensions;
Expand Down Expand Up @@ -61,7 +62,8 @@ public void GenerateIncludeForwardRefs()
if (typeRef.Include.TranslationUnit == TranslationUnit)
continue;

if (typeRef.Include.File == TranslationUnit.FileName)
var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName;
if (typeRef.Include.File == filename)
continue;

var include = typeRef.Include;
Expand Down
4 changes: 3 additions & 1 deletion src/Generator/Generators/CLI/CLISources.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using CppSharp.AST;
using CppSharp.AST.Extensions;
Expand Down Expand Up @@ -61,7 +62,8 @@ public void GenerateForwardReferenceHeaders()

foreach (var typeRef in typeReferenceCollector.TypeReferences)
{
if (typeRef.Include.File == TranslationUnit.FileName)
var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName;
if (typeRef.Include.File == filename)
continue;

var include = typeRef.Include;
Expand Down