Permalink
Browse files

Added Function Delegate support

  • Loading branch information...
1 parent d05e6a5 commit 9dfbe6a39e34045273ff90e8a78599b229da1614 @kthompson committed May 12, 2012
Showing with 5,110 additions and 4,274 deletions.
  1. +16 −0 Tester/Program.cs
  2. +36 −0 Tester/Properties/AssemblyInfo.cs
  3. +70 −0 Tester/Tester.csproj
  4. +6 −0 Tester/Tester.csproj.user
  5. +3 −0 Tester/app.config
  6. 0 autogen.sh
  7. +77 −68 cxxi.sln
  8. +1,046 −1,046 src/Mono.Cxxi/Abi/CppAbi.cs
  9. +93 −93 src/Mono.Cxxi/Abi/Impl/ItaniumTypeInfo.cs
  10. +325 −310 src/Mono.Cxxi/Abi/Impl/MsvcAbi.cs
  11. +243 −243 src/Mono.Cxxi/Abi/VTable.cs
  12. +45 −40 src/Mono.Cxxi/Attributes.cs
  13. +64 −64 src/Mono.Cxxi/ByReference.cs
  14. +272 −272 src/Mono.Cxxi/CppInstancePtr.cs
  15. +21 −0 src/Mono.Cxxi/CppMarshaler.cs
  16. +6 −4 src/Mono.Cxxi/CppModifiers.cs
  17. +4 −1 src/Mono.Cxxi/CppType.cs
  18. +120 −120 src/Mono.Cxxi/CppTypeInfo.cs
  19. +148 −145 src/Mono.Cxxi/Mono.Cxxi.csproj
  20. +192 −0 src/Mono.Cxxi/WeakDelegate.cs
  21. +114 −0 src/Mono.Cxxi/WeakDelegateCollector.cs
  22. +7 −0 src/generator/Class.cs
  23. +59 −0 src/generator/Function.cs
  24. +843 −746 src/generator/Generator.cs
  25. +5 −0 src/generator/Method.cs
  26. +1 −1 src/generator/Namespace.cs
  27. +7 −0 src/generator/Templates/BaseMembers.cs
  28. +428 −254 src/generator/Templates/CSharp/CSharpClass.cs
  29. +68 −8 src/generator/Templates/CSharp/CSharpClass.tt
  30. +214 −0 src/generator/Templates/CSharp/CSharpFunction.cs
  31. +58 −0 src/generator/Templates/CSharp/CSharpFunction.tt
  32. +191 −172 src/generator/generator.csproj
  33. +20 −20 src/generator/generator.sln
  34. +29 −29 tests/FieldTests.cs
  35. +22 −22 tests/InheritanceTests.cs
  36. +16 −1 tests/ManglingTests.cs
  37. +15 −0 tests/Native/ManglingTests.cpp
  38. +10 −0 tests/Native/ManglingTests.h
  39. +177 −174 tests/Tests.csproj
  40. +35 −441 tests/VSClassLayouts.txt
  41. +4 −0 tests/packages.config
View
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tests;
+
+namespace Tester
+{
+ class Program
+ {
+ static void Main (string[] args)
+ {
+ var tests = new ManglingTests();
+ tests.TestCompression();
+ }
+ }
+}
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle ("Tester")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("Tester")]
+[assembly: AssemblyCopyright ("Copyright © 2012")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible (false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid ("8f312522-1ccc-4583-9a47-ae3794136c57")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyFileVersion ("1.0.0.0")]
View
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tester</RootNamespace>
+ <AssemblyName>Tester</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\bin\Debug\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\src\Mono.Cxxi\Mono.Cxxi.csproj">
+ <Project>{4A864586-93C5-4DC1-8A80-F094A88506D7}</Project>
+ <Name>Mono.Cxxi</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\tests\Tests.csproj">
+ <Project>{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}</Project>
+ <Name>Tests</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>
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
+ </PropertyGroup>
+</Project>
View
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
View
0 autogen.sh 100755 → 100644
No changes.
View
145 cxxi.sln
@@ -1,68 +1,77 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cxxi", "src\Mono.Cxxi\Mono.Cxxi.csproj", "{4A864586-93C5-4DC1-8A80-F094A88506D7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "src\generator\generator.csproj", "{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|x86.ActiveCfg = Debug|x86
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|x86.Build.0 = Debug|x86
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.Build.0 = Release|Any CPU
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|x86.ActiveCfg = Release|x86
- {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|x86.Build.0 = Release|x86
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|x86.ActiveCfg = Debug|x86
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.Build.0 = Release|Any CPU
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|x86.ActiveCfg = Release|x86
- {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|x86.Build.0 = Release|x86
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|x86.ActiveCfg = Debug|x86
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|x86.Build.0 = Debug|x86
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.Build.0 = Release|Any CPU
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|x86.ActiveCfg = Release|x86
- {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = src\generator\generator.csproj
- Policies = $0
- $0.TextStylePolicy = $1
- $1.inheritsSet = null
- $1.scope = text/x-csharp
- $0.CSharpFormattingPolicy = $2
- $2.NamespaceBraceStyle = EndOfLine
- $2.ClassBraceStyle = EndOfLine
- $2.InterfaceBraceStyle = EndOfLine
- $2.StructBraceStyle = EndOfLine
- $2.EnumBraceStyle = EndOfLine
- $2.inheritsSet = Mono
- $2.inheritsScope = text/x-csharp
- $2.scope = text/x-csharp
- $0.TextStylePolicy = $3
- $3.FileWidth = 120
- $3.TabWidth = 4
- $3.RemoveTrailingWhitespace = True
- $3.inheritsSet = Mono
- $3.inheritsScope = text/plain
- $3.scope = text/plain
- name = CPPInterop
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cxxi", "src\Mono.Cxxi\Mono.Cxxi.csproj", "{4A864586-93C5-4DC1-8A80-F094A88506D7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "src\generator\generator.csproj", "{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|x86.ActiveCfg = Debug|x86
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|x86.Build.0 = Debug|x86
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|x86.ActiveCfg = Release|x86
+ {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|x86.Build.0 = Release|x86
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|x86.ActiveCfg = Debug|x86
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Debug|x86.Build.0 = Debug|x86
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|x86.ActiveCfg = Release|x86
+ {3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}.Release|x86.Build.0 = Release|x86
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|x86.ActiveCfg = Debug|x86
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|x86.Build.0 = Debug|x86
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|x86.ActiveCfg = Release|x86
+ {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|x86.Build.0 = Release|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Debug|x86.ActiveCfg = Debug|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Debug|x86.Build.0 = Debug|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Release|Any CPU.ActiveCfg = Release|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Release|x86.ActiveCfg = Release|x86
+ {6C622CB6-7CC2-4C91-BB72-F38FBBD5DAD2}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = src\generator\generator.csproj
+ Policies = $0
+ $0.TextStylePolicy = $1
+ $1.inheritsSet = null
+ $1.scope = text/x-csharp
+ $0.CSharpFormattingPolicy = $2
+ $2.NamespaceBraceStyle = EndOfLine
+ $2.ClassBraceStyle = EndOfLine
+ $2.InterfaceBraceStyle = EndOfLine
+ $2.StructBraceStyle = EndOfLine
+ $2.EnumBraceStyle = EndOfLine
+ $2.inheritsSet = Mono
+ $2.inheritsScope = text/x-csharp
+ $2.scope = text/x-csharp
+ $0.TextStylePolicy = $3
+ $3.FileWidth = 120
+ $3.TabWidth = 4
+ $3.RemoveTrailingWhitespace = True
+ $3.inheritsSet = Mono
+ $3.inheritsScope = text/plain
+ $3.scope = text/plain
+ name = CPPInterop
+ EndGlobalSection
+EndGlobal
Oops, something went wrong.

0 comments on commit 9dfbe6a

Please sign in to comment.