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
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"using System;
Expand Down Expand Up @@ -533,13 +535,13 @@ public int GetType(int objA, int objB)

public partial struct Vtbl
{{
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "new ")}IntPtr GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")};

[NativeTypeName(""int ()"")]
[NativeTypeName(""int (){nativeCallConv}"")]
public IntPtr GetType1;

[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "new " : "")}IntPtr GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")};
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"using System;
Expand Down Expand Up @@ -533,13 +535,13 @@ public int GetType(int objA, int objB)

public partial struct Vtbl
{{
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "new ")}IntPtr GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")};

[NativeTypeName(""int ()"")]
[NativeTypeName(""int (){nativeCallConv}"")]
public IntPtr GetType1;

[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "new " : "")}IntPtr GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")};
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public override Task NewKeywordVirtualTest()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -464,10 +464,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -495,13 +497,13 @@ public int GetType(int objA, int objB)

public partial struct Vtbl
{{
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "new ")}delegate* unmanaged[{callConv}]<MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", int" : "")}> GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")};

[NativeTypeName(""int ()"")]
[NativeTypeName(""int (){nativeCallConv}"")]
public delegate* unmanaged[{callConv}]<MyStruct*, int> GetType1;

[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "new " : "")}delegate* unmanaged[{callConv}]<MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : ", int")}> GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")};
}}
}}
Expand Down Expand Up @@ -773,7 +775,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -833,7 +835,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ struct MyStructB : MyStructA { };

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public override Task NewKeywordVirtualTest()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -464,10 +464,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -495,13 +497,13 @@ public int GetType(int objA, int objB)

public partial struct Vtbl
{{
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "new ")}delegate* unmanaged[{callConv}]<MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", int" : "")}> GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")};

[NativeTypeName(""int ()"")]
[NativeTypeName(""int (){nativeCallConv}"")]
public delegate* unmanaged[{callConv}]<MyStruct*, int> GetType1;

[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"")]
[NativeTypeName(""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"")]
public {(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "new " : "")}delegate* unmanaged[{callConv}]<MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : ", int")}> GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")};
}}
}}
Expand Down Expand Up @@ -773,7 +775,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -833,7 +835,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ struct MyStructB : MyStructA { };

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"using System.Runtime.CompilerServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down Expand Up @@ -644,13 +646,13 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
</function>
<vtbl>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"">IntPtr</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"">IntPtr</type>
</field>
<field name=""GetType1"" access=""public"">
<type native=""int ()"">IntPtr</type>
<type native=""int (){nativeCallConv}"">IntPtr</type>
</field>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"">IntPtr</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"">IntPtr</type>
</field>
</vtbl>
</struct>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down Expand Up @@ -644,13 +646,13 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
</function>
<vtbl>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"">IntPtr</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"">IntPtr</type>
</field>
<field name=""GetType1"" access=""public"">
<type native=""int ()"">IntPtr</type>
<type native=""int (){nativeCallConv}"">IntPtr</type>
</field>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"">IntPtr</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"">IntPtr</type>
</field>
</vtbl>
</struct>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public override Task NewKeywordVirtualTest()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down Expand Up @@ -530,10 +530,12 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
};";

var callConv = "Cdecl";
var nativeCallConv = "";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
nativeCallConv = " __attribute__((thiscall))";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down Expand Up @@ -572,13 +574,13 @@ public override Task NewKeywordVirtualWithExplicitVtblTest()
</function>
<vtbl>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "2" : "")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", int" : "")}&gt;</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int, int)" : "int (int)")}{nativeCallConv}"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", int" : "")}&gt;</type>
</field>
<field name=""GetType1"" access=""public"">
<type native=""int ()"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int&gt;</type>
<type native=""int (){nativeCallConv}"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int&gt;</type>
</field>
<field name=""GetType{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : "2")}"" access=""public"">
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : ", int")}&gt;</type>
<type native=""{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "int (int)" : "int (int, int)")}{nativeCallConv}"">delegate* unmanaged[{callConv}]&lt;MyStruct*, int, int{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "" : ", int")}&gt;</type>
</field>
</vtbl>
</struct>
Expand Down Expand Up @@ -885,7 +887,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down Expand Up @@ -948,7 +950,7 @@ virtual char MyInt8Method()

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ struct MyStructB : MyStructA { };

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !Environment.Is64BitProcess)
{
callConv = "ThisCall";
callConv = "Thiscall";
}

var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
Expand Down
Loading