Trung Nguyen
add3aba684
CSharp: More default parameter fixes ( #1747 )
...
- Expression generation for `ConstructorReference` now also recursively
calls `VisitExpression` for the argument if only one argument is
detected. This allows correct overload generation for functions taking
a variable as the default parameter value.
- Default parameters of pointer-to-enumeration types are now correctly
generated similar to primitive types.
2 years ago
Trung Nguyen
1ce9cb7e7f
CSharpExpressionPrinter: Recurse into operands ( #1745 )
...
* CSharpExpressionPrinter: Recurse into operands
Recursively call `VisitExpression` on the LHS and RHS of a binary
operator expression. This fixes the generation for complex default
parameters involving things other than two enumeration members.
* CSharpSources: Use `const` when possible
Generate `const` instead of `static` members when possible.
This allows generated members to be used when compile-time constants are
required, such as default parameters.
2 years ago
João Matos
160efb469a
Update README.md
...
Remove Gitter since the link is 404 and we have not been using it anyway.
2 years ago
Trung Nguyen
169f8686a9
CSharpExpressionPrinter: Wrap expression in parenthesis ( #1741 )
...
Wrap default parameter expressions in parentheses to ensure whole expressions are casted instead of only the first operand.
2 years ago
stachu99
9923d79617
CppSharp.AST.Declaration - fix return QualifiedOriginalName, QualifiedLogicalOriginalName ( #1740 )
...
Fixed properties getters of QualifiedOriginalName, QualifiedLogicalOriginalName and methods GetQualifiedName(), GatherNamespaces.
2 years ago
João Matos
02725320fd
Workaround parsing GNU system headers with GCC 11.0 version. ( #1737 )
...
Closes https://github.com/mono/CppSharp/issues/1703 .
Upstream bugs:
https://github.com/llvm/llvm-project/issues/51607
https://github.com/llvm/llvm-project/issues/53152
2 years ago
João Matos
dc743a23ce
Fix module being ignored when it cannot be found based on include dir. ( #1736 )
2 years ago
Joao Matos
25e2c7c0aa
Workaround Directory.Build.props getting picked up when building LLVM.
...
This is to workaround MSBuild CMake step from LLVM build in Windows
picking this up.
2 years ago
Joao Matos
b8a16a45b1
Update LLVM build script for Visual Studio 2022.
2 years ago
Joao Matos
7d6decd8b7
Update action steps to latest to fix Node.js deprecation warnings.
2 years ago
Joao Matos
f9f9e9c2bc
Update LLVM Windows workflow to latest Action images.
2 years ago
Joao Matos
3d32fc7d87
Update LLVM workflow to latest Action images.
2 years ago
Joao Matos
84b7276114
Remove unused LLVM build flags.
2 years ago
João Matos
8cf6e3f280
Allow passing a `-target-framework` option to `build.sh` ( #1718 )
...
Closes https://github.com/mono/CppSharp/issues/1717 .
2 years ago
josetr
5715df5a72
Publish package to nuget.org when a version tag is created
2 years ago
João Matos
4417dd987a
Code cleanups and improvements ( #1713 )
...
* Code cleanups.
* Run GetterSetterToPropertyPass for more generators.
* Fixed compile warning when compiling parser bindings.
* Cleanup driver code.
* Remove dead 32-bit code.
* Reduce verbosity when Options.Quiet is set.
* Remove test compile-time warnings.
* Move .NET tests to tests/dotnet.
* Remove unused AST viewer code and premake-qt submodule.
* Move tests2/ contents to tests/.
2 years ago
João Matos
117567d61f
Add initial Emscripten generator. ( #1712 )
2 years ago
João Matos
9b06e7bc01
Add C++ WebAssembly ABI ( #1711 )
...
* Minor code refactorings.
* Fix debug assert issue with vtable methods.
* Add support for WebAssembly C++ ABI to parser and AST converter.
2 years ago
João Matos
db7949b263
Misc changes ( #1710 )
...
* Minor code refactoring for re-use.
* Add Class.FindVariable helper method.
* Upgrade to .NET 6.
2 years ago
aybe
c4a24b0cce
Incorrect build instructions on Windows ( #1701 )
...
* Fix incorrect build instructions for Windows
* Add link to Visual Studio installer
* Refine building instructions for VS2019+
3 years ago
Fabio Anderegg
7998b24516
write pragma to disable new keyword not required warnings ( #1697 )
3 years ago
Fabio Anderegg
92f774aabf
__CreateInstance: return C# null when native is null ( #1698 )
3 years ago
Fabio Anderegg
eab7a0cdde
Fix disabling NativeToManaged map for classes with vtable ( #1696 )
...
* dont generate GetInstance on classes with disabled NativeToManaged map
* disable vtable hooking for classes with disabled ManagedToNative
* throw exception when trying to inherit from class with disabled NativeToManaged map
3 years ago
josetr
f2e26ec7af
Simplify "Upload package to GitHub Packages" step
3 years ago
josetr
567a0df8c7
Fix FunctionToInstanceMethod
3 years ago
josetr
fd058db061
Rename tests
3 years ago
josetr
c1b3a1e4d4
Fix HasDependentValueFieldInLayout stack overflow
3 years ago
josetr
efdec41f13
Add missing GenerateNativeToManagedFor checks
3 years ago
josetr
e160b3a296
Add generate function template specializations whitelist
3 years ago
josetr
7fb553f79e
Code to generate function template specializations should support methods as well
3 years ago
josetr
51f06fd7cf
Add missing parenthesis when printing a reference to an array
3 years ago
josetr
b92a128ba6
Add missing const specifier when printing C arrays
3 years ago
josetr
6a414f37c3
Fix SymbolCodeGenerator printing typed enums as normal typeless integers
3 years ago
Fabio Anderegg
a642691348
Call destructor on copied arguments when calling C# method from C++ (MS ABIs only) ( #1685 )
...
* on MS abi call destructor on copy-by-value arguments after call to c# function
* add tests for destructor call on call by value from c++ to c#
* copy-by-value destructor call using Dispose() instead of Internal.dtor to handle destructors in base class
3 years ago
João Matos
ea5c09502f
Update GettingStarted.md
3 years ago
Joao Matos
5a202e9be2
Support parsing record fields in WalkDeclaration.
...
This fixes an issue with parsing of class fields being used as a
template argument.
3 years ago
Fabio Anderegg
75feb4ebc6
RenamePass: add option to include/exclude namespaces from renaming ( #1670 )
3 years ago
hxbb00
ef29be59cd
fix:RTTI head loss ( #1675 )
...
Co-authored-by: hujin <hj@mapgis.com>
3 years ago
João Matos
ce9e63f4ce
Move to macOS 11 on GitHub Actions. ( #1671 )
3 years ago
josetr
ed278fc636
Refactor code
3 years ago
josetr
060afd53fc
Add partial `ref` param support
3 years ago
josetr
565776ef9e
Fix issue where a `ref` parameter would always be overwritten
3 years ago
josetr
17f69fdf64
Add test for function templates
3 years ago
josetr
0d92eaef16
Use TemplatedDecl.Parameters cuz Class.TemplateParameters may not be available at this point
3 years ago
josetr
06d311dc89
Fix anonymous unions inside template classes
3 years ago
josetr
6bf823e3b9
Fix IsInternalClassNested usage
3 years ago
josetr
37bd7e0155
Add `GenerateNativeToManaged` per-class option
3 years ago
josetr
3414294ab8
Fix FunctionToStaticMethod bug
3 years ago
josetr
27d9adb20c
Remove duplicate IsNativeMethod functions
3 years ago
Joao Matos
314a1f745f
Parse generate function template specializations.
3 years ago