Skip to content

Commit

Permalink
Make ClangSharp self-hosting by duplicating ...
Browse files Browse the repository at this point in the history
Generated.cs is now duplicated inside ClangSharpPInvokeGenerator so that
it can self hosted.
  • Loading branch information
mjsabby committed Feb 23, 2015
1 parent 70a4208 commit 7ae9c88
Show file tree
Hide file tree
Showing 10 changed files with 2,077 additions and 115 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion ClangSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClangSharp", "ClangSharp\ClangSharp.csproj", "{6091B9F6-D75E-4457-BF5B-89076FCB262B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClangSharp", "ClangSharp.csproj", "{6091B9F6-D75E-4457-BF5B-89076FCB262B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClangSharpPInvokeGenerator", "ClangSharpPInvokeGenerator\ClangSharpPInvokeGenerator.csproj", "{FF792C72-8F27-474E-B6AD-9D3F646BC98D}"
EndProject
Expand Down
28 changes: 0 additions & 28 deletions ClangSharp/ClangSharp.sln

This file was deleted.

36 changes: 0 additions & 36 deletions ClangSharp/Properties/AssemblyInfo.cs

This file was deleted.

File renamed without changes.
16 changes: 2 additions & 14 deletions ClangSharpPInvokeGenerator/ClangSharpPInvokeGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,16 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClangSharp.Extensions.cs" />
<Compile Include="Generated.cs" />
<Compile Include="EnumVisitor.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="ForwardDeclarationVisitor.cs" />
<Compile Include="ICXCursorVisitor.cs" />
<Compile Include="TypeDefVisitor.cs" />
<Compile Include="FunctionVisitor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StructVisitor.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClangSharp\ClangSharp.csproj">
<Project>{6091b9f6-d75e-4457-bf5b-89076fcb262b}</Project>
<Name>ClangSharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
File renamed without changes.
36 changes: 0 additions & 36 deletions ClangSharpPInvokeGenerator/Properties/AssemblyInfo.cs

This file was deleted.

38 changes: 38 additions & 0 deletions Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace ClangSharp
{
using System.Runtime.InteropServices;

public partial struct CXString
{
public override string ToString()
{
string retval = Marshal.PtrToStringAnsi(this.data);
clang.disposeString(this);
return retval;
}
}

public partial struct CXType
{
public override string ToString()
{
return clang.getTypeSpelling(this).ToString();
}
}

public partial struct CXCursor
{
public override string ToString()
{
return clang.getCursorSpelling(this).ToString();
}
}

public partial struct CXDiagnostic
{
public override string ToString()
{
return clang.getDiagnosticSpelling(this).ToString();
}
}
}
Loading

0 comments on commit 7ae9c88

Please sign in to comment.