Skip to content

Commit 7105c10

Browse files
Cleanup to resolves some bugs and codegen issues (#215)
* Adding an option for generating a VtblIndex attribute * Adding tests validating the VtblIndexAttribute, NativeInheritanceAttribute, and explicit vtbl generation * Move fnptr and nint codegen to be part of latest by default * Ensure multi-dimensional fixed-sized buffers use the correct name for the first field * Ensure multi-dimensional buffers are correctly handled for variable declarations * Ensure we use main and beta3 in our CI and versions
1 parent 491e24b commit 7105c10

File tree

100 files changed

+2327
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2327
-509
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(Configuration)/</PackageOutputPath>
4444
<Product>ClangSharp</Product>
4545
<VersionPrefix>11.0.0</VersionPrefix>
46-
<VersionSuffix>beta2</VersionSuffix>
46+
<VersionSuffix>beta3</VersionSuffix>
4747
<VersionSuffix Condition="'$(BUILD_REASON)' == 'PullRequest'">pr</VersionSuffix>
4848
</PropertyGroup>
4949

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ ClangSharp provides Clang bindings written in C#. It is self-hosted and auto-gen
44

55
| Job | Debug Status | Release Status |
66
| --- | ------------ | -------------- |
7-
| Windows x86 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_debug_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_release_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
8-
| Windows x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
9-
| Ubuntu 18.04 x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=ubuntu_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=ubuntu_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
10-
| MacOS x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=macos_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=macos_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
7+
| Windows x86 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=windows_debug_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=windows_release_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) |
8+
| Windows x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=windows_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=windows_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) |
9+
| Ubuntu 18.04 x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=ubuntu_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=ubuntu_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) |
10+
| MacOS x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=macos_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=main&jobName=macos_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=main) |
1111

1212
A nuget package for the project is provided here: https://www.nuget.org/packages/clangsharp.
1313
A .NET tool for the P/Invoke generator project is provided here: https://www.nuget.org/packages/ClangSharpPInvokeGenerator
@@ -93,7 +93,7 @@ dotnet tool install --global ClangSharpPInvokeGenerator --version 11.0.0-beta2
9393
ClangSharpPInvokeGenerator @generate.rsp
9494
```
9595

96-
A response file allows you to specify and checkin the command line arguments in a text file, with one argument per line. For example: https://github.com/microsoft/ClangSharp/blob/master/sources/ClangSharpPInvokeGenerator/Properties/GenerateClang.rsp
96+
A response file allows you to specify and checkin the command line arguments in a text file, with one argument per line. For example: https://github.com/microsoft/ClangSharp/blob/main/sources/ClangSharpPInvokeGenerator/Properties/GenerateClang.rsp
9797
At a minimum, the command line expects one or more input files (`-f`), an output namespace (`-n`), and an output location (`-o`). A typical response file may also specify explicit files to traverse, configuration options, name remappings, and other fixups.
9898

9999
The full set of available switches:
@@ -194,7 +194,11 @@ Options:
194194
are commonly encountered for opaque handle like types such as HWND.
195195
exclude-enum-operators Bindings for operators over enum types should not be generated. These are
196196
largely unnecessary in C# as the operators are available by default.
197+
exclude-fnptr-codegen Generated bindings for latest or preview codegen should not use function
198+
pointers.
197199
exclude-funcs-with-body Bindings for functions with bodies should not be generated.
200+
preview-codegen-nint Generated bindings for latest or preview codegen should not use nint or
201+
nuint.
198202
exclude-using-statics-for-enums Enum usages should be fully qualified and should not include a
199203
corresponding 'using static EnumName;'
200204
@@ -209,24 +213,21 @@ Options:
209213
210214
generate-aggressive-inlining [MethodImpl(MethodImplOptions.AggressiveInlining)] should be added to
211215
generated helper functions.
212-
generate-cpp-attributes A[CppAttributeList("")] should be generated to document the encountered C++
216+
generate-cpp-attributes [CppAttributeList("")] should be generated to document the encountered C++
213217
attributes.
214218
generate-macro-bindings Bindings for macro-definitions should be generated. This currently only
215219
works with value like macros and not function-like ones.
216-
generate-native-inheritance-attribute A[NativeInheritance("")] attribute should be generated to document the
220+
generate-native-inheritance-attribute [NativeInheritance("")] attribute should be generated to document the
217221
encountered C++ base type.
222+
generate-vtbl-index-attribute [VtblIndex(#)] attribute should be generated to document the underlying
223+
VTBL index for a helper method.
218224
219225
log-exclusions Alist of excluded declaration types should be generated. This will also log
220226
if the exclusion was due to an exact or partial match.
221227
log-potential-typedef-remappings Alist of potential typedef remappings should be generated. This can help
222228
identify missing remappings.
223229
log-visited-files Alist of the visited files should be generated. This can help identify
224230
traversal issues.
225-
226-
preview-codegen-fnptr Generated bindings should use function pointers instead of IntPtr where
227-
possible.
228-
preview-codegen-nint Generated bindings should use nint and nuint instead of IntPtr and UIntPtr
229-
where possible.
230231
```
231232

232233
## Spotlight

packages/libClangSharp/libClangSharp.runtime.freebsd.11-x64/libClangSharp.runtime.freebsd.11-x64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.freebsd.11-x64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>freebsd 11 x64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.freebsd.11-x86/libClangSharp.runtime.freebsd.11-x86.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.freebsd.11-x86</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>freebsd 11 x86 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.linux-arm/libClangSharp.runtime.linux-arm.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.linux-arm</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>linux arm native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.linux-arm64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>linux arm64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.osx-x64/libClangSharp.runtime.osx-x64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.osx-x64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>osx x64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.ubuntu.18.04-x64/libClangSharp.runtime.ubuntu.18.04-x64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.ubuntu.18.04-x64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>ubuntu 18.04 x64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.ubuntu.20.04-x64/libClangSharp.runtime.ubuntu.20.04-x64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.ubuntu.20.04-x64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>ubuntu 20.04 x64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

packages/libClangSharp/libClangSharp.runtime.win-x64/libClangSharp.runtime.win-x64.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.win-x64</id>
5-
<version>11.0.0-beta2</version>
5+
<version>11.0.0-beta3</version>
66
<authors>Microsoft and Contributors</authors>
77
<owners>Microsoft and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">NCSA</license>
1010
<projectUrl>https://github.com/microsoft/clangsharp</projectUrl>
1111
<description>win x64 native library for libClangSharp.</description>
1212
<copyright>Copyright © Microsoft and Contributors</copyright>
13-
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="master" />
13+
<repository type="git" url="https://github.com/microsoft/clangsharp" branch="main" />
1414
</metadata>
1515
<files>
1616
<file src="..\libClangSharp\LICENSE.TXT" target="LICENSE.TXT" />

0 commit comments

Comments
 (0)