Joao Matos
363a242281
Make the converted declaration cache more robust.
...
We were getting a failure due to duplicated original pointers. Make it
take the declaration kind into account as a key to the cache.
2 years ago
Joao Matos
53e20e9f88
Improve error handling for failed library parsing.
2 years ago
Joao Matos
fc3f0deb55
Fix missing Attribute dtor in GCC 11.
...
Parser bindings are expecting this, yet this was optimized out under GCC
11.
2 years ago
Pixelstorm
25d6325b13
Fix crash on Linux by `DllImport`ing correct version of libdl ( #1764 )
...
* DllImport correct version of libdl
* Fix macOS
2 years ago
Joao Matos
3c31179db1
Use TypePrinter.IntPtrType in CSharpSources.cs code from previous commit.
2 years ago
Trung Nguyen
ce3d04abd7
CSharpSources: Dereference pointer variables ( #1753 )
...
Dereference pointers when generating getters for pointer variables.
Otherwise, the managed instance would point to the pointer itself
rather than the object at the native instance's address.
2 years ago
Trung Nguyen
3978fb3be9
SymbolResolver: Use filename when path cannot be found ( #1752 )
...
Uses bare filename to pass to `dlopen` when the full path cannot
be detected. This helps on systems where library paths are not the
same as $PATH.
2 years ago
João Matos
626a362698
Add qualified template name to GetCXXRecordDeclFromBaseType. ( #1751 )
2 years ago
Trung Nguyen
357efec91b
Array marshalling ( #1748 )
...
* Generator: Customization for const char[]
Allow the user to choose whether `const char[]` should be marshalled as
`string` or a normal `char` array in C#.
A new option `MarshalConstCharArrayAsString` is added, and is `true`
by default.
This helps in situations where the original C++ API distinguishes
between C-strings and char arrays using the two different notations.
* CSharpMarshal: Fix unknown length array marshal
For unknown length arrays, also run a conversion loop if the primitive
type encountered needs conversion (e.g. `char` to `sbyte`).
* CSharpTypePrinter: Fix for boolean arrays
2 years ago
Joao Matos
9f3ce76261
Fixed debugging printing when type printing delegate is not initialized.
2 years ago
Joao Matos
8c1fa18ccb
Update parser example to latest API.
2 years ago
João Matos
bb31bd616b
Add type parameter to non-type template parameter decls. ( #1749 )
2 years ago
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