Albert Szilvasy
24b02e4d86
Fix incorrect dtor call for non-owned instances ( #1615 )
...
* Introduce failing test for disposing bug
* Dispose(bool, bool) really shouldn't be public. Clients should call Dipose() instead.
Derived classes may need to call Dispose(bool, bool) so lets make it internal protected.
4 years ago
Dimitar Dobrev
36c9e5f60a
Fix regressed marshalling of lists in C++/CLI
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Albert Szilvasy
a178108c06
Fix for Visual Studio 2019 16.10 ( #1614 )
4 years ago
Dimitar Dobrev
5c58a5993e
Generate valid C# for public fields of typedef-ed primitive pointer
...
Fixes https://github.com/mono/CppSharp/issues/1611 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
954a0cf941
Resolve names matching those of system functions
...
Fixes https://github.com/mono/CppSharp/issues/1602 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
João Matos
359cc90a49
Update UsersManual.md
4 years ago
Joe Hull
748b7b5d03
Add a mechanism to selectively initialize allocated unmanaged memory in the default constructor.
...
* feature: Add a mechanism to selectively initialize unmanaged memory in the default constructor. (C# Only at this point).
* Use the global:: prefix when calling InitBlock
4 years ago
Joe Hull
b3a7cd0261
Much improved support for marshaling const char* to string
...
* Changed support for marshaling "const char *"s as strings so that:
1) CppSharp.Types.Std.CSharpMarshalToNative generates setters that allocate unmanaged memory for the native bytes rather than an unpinned pointer into managed memory. Also set a null termination char.
2) Add tracking for when unmanaged memory is allocated for "const char *" strings. Free it when reassigned or dispsoed.
3) Added explicit support for Encoding.Default for ANSI support.
4) Allow setting a string value to null.
* Added test to prove that the unpinned ptr to managed memory approach wasn't working, and that the new approach appears to work.
* Change CSharpSources.GenerateDisposeMethods to free unmanaged memory held by IntPtr's corresponding to "const char *" strings.
* Changed copy constructor to deep-copy owned string refs to avoid ref counting.
* Update CSharpSources.GenerateFieldGetter to treat Char16 and Char32 the same as WideChar to avoid compilation errors on the generated sources if char32_t or char16_t are used.
* Added tests.
* Workaround for mac C++ compilation issue.
4 years ago
Joe Hull
03bf194b63
Enhanced ExpressionEvaluator to return implicitly typed uint, long, and ulong values from EvaluateNumber when there is no literal type suffix applied to a numeric expression string.
...
Changed Library.GenerateEnumFromMacro and friends to track the primitive type of the Enumeration while building an Enumeration's list of items so that we can support negative items within an Enumeration.
Fixed bugs in GetUnderlyingTypeForEnumValue where "<" should have been "<=" and Long should have been LongLong. Extended it to support negative values.
Added tests.
4 years ago
Joe Hull
677991b705
Attempt to resolve a GitHub CI Actions isue: CI is currently failing because restore can't find NUnit and friends. The error message and google search indicate that GitHub Actions is only looking in the "Microsoft Visual Studio Offline Packages" cache. Add a nuget.config file to in an attempt to tell GitHub Actions to query nuget.org in addition to the offline cache.
4 years ago
Joe Hull
eb0d4c15f1
bug fix: When generating the get accessor for a field composed of an embedded array of structs use __GetOrCreateInstance to initialize the managed array wrapper rather than __CreateInstance so that __Instance holds a pointer to the memory allocated for the array in the outer struct rather than an independent copy of that memory.
...
Added a test.
TODO: once allocated, we may want to cache the managed array. Does this
issue exist in other generators as well?
4 years ago
Joe Hull
d135ffdb86
bug: Repaired broken alignment padding generation for structs with embedded arrays of structs. Added a test for this case.
4 years ago
ElonH
af275edb55
generate comment for field
4 years ago
Dimitar Dobrev
e2c81df194
Fix a regression when printing C++ methods
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0ff9e14226
Update LLVM to the latest version
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
ElonH
c805fcf92b
document syntax warning
...
Generate XML Documentation Files
4 years ago
Dimitar Dobrev
0e249d0986
Fix the regressed generation of C++ for variables
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
299c34c80e
Build LLVM for windows in C:\ for more free space
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
João Matos
a3805f84c9
Update GettingStarted.md
4 years ago
Joao Matos
ee271371d3
Minor refactoring in CCodeGenerator.GetMethodIdentifier.
4 years ago
Joao Matos
c6e263e269
Add work-in-progress TypeScript interface bindings generator.
4 years ago
Joao Matos
28694431c7
C/C++ type printing fixes.
4 years ago
Joao Matos
0595fcfc9e
Add MarkEventsWithUniqueIdPass pass for global event handling.
4 years ago
Joao Matos
4deb35e272
Maintain DeclarationsList integrity by clearing item offsets.
4 years ago
Joao Matos
cb852acfdc
Add CppSharp VS Code workspace.
4 years ago
Joao Matos
c9530a292c
Ignore external projects.
4 years ago
Joao Matos
be1298a35c
Update JS tests.
4 years ago
Joao Matos
5004d9eada
Rework core implementation of QuickJS generator.
...
This adds more accurate overloading, default arguments handling and
events.
4 years ago
Joao Matos
720304ce0a
Implement two-step initialization for QuickJS.
4 years ago
Joao Matos
91c65c5515
Add QuickJS runtime project and initial features.
4 years ago
Joao Matos
cc15c23250
Improve support for default arguments in NAPI generator.
4 years ago
Joao Matos
494419de7b
Add support for generation of default argument expressions in C generator.
...
For now this only uses the C# code, needs some future work.
4 years ago
Joao Matos
f0becc879c
Add experimental GenerateExternalDataFields option and supporting code.
4 years ago
Joao Matos
19a88e3ad5
Minor refactoring fixes in CppTypePrinter.
4 years ago
Joao Matos
6671f56803
Add C code generator GenerateClassEvents for common event handling.
4 years ago
Joao Matos
eed362841c
Introduce a scope kind stack for type printers.
...
Just like we already have for other context data.
4 years ago
Joao Matos
57c9c48229
Rework C enum generation for more accurate handling.
4 years ago
Joao Matos
1e8db6020e
Add convenience constructor to ArrayType.
4 years ago
Joao Matos
2a8674c129
Create target directory when generating files.
4 years ago
Joao Matos
3746407f8e
Add new pass to convert C++ FastDelegate types into CppSharp delegates.
4 years ago
Joao Matos
50451ac897
Code cleanup.
4 years ago
Dimitar Dobrev
1209f1af42
Test C++11 in-class member initializers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
3313aa1939
Document release 0.11.1
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
1e8bfb11e3
Remove looking MSVC headers up with COM
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4f495181e5
Regenerate the parser bindings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
2314b21093
Fix regressed names of generated source files
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
33e94b5f1f
Look for the Clang headers along the main entry
...
This fixes a crash in our new NuGet where the executable code we used as a guide before, is now located in nested arch-specific folders.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
6d3f676db9
Regenerate the parser bindings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
e913a00d11
Fix the crashing disposal of a non-set up driver
...
Fixes https://github.com/mono/CppSharp/issues/1404 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
ba2310830a
Remove needless generation of using-s in tests
...
Fixes https://github.com/mono/CppSharp/issues/1490 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago