Dimitar Dobrev
bc7cfb24ae
Swich to the new mach-o support for C++ linking
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
76d6795bbf
Add built-in compilation of extra symbols
...
Fixes https://github.com/mono/CppSharp/issues/1456 and https://github.com/mono/CppSharp/issues/1253 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
2f2cf7da02
Fix naming for function pointers with strings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0d8b236f7e
Ignore external (no module) translation units
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
851ec5e44c
Fix instantiation of specializations not to crash
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0e963aa03f
Generate valid C# for default args: typedefed refs to enums assigned empty ctors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
15a55483ff
Extend finding of functions to also get overloads
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
385c5e9387
Ensure valid C# for default args assigned secondary bases
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
49122e0d62
Generate valid C++ for protected ctors of pure classes
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
42f38ec99e
Generate valid C# for constants in namespaceless modules
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
9c52adae09
Generate valid C# for types nested in external typedef-ed specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
f5bed3223d
Generate valid C# with explicit external specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4649052f2c
Fix templated indexers returning objects
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
6dfabb6273
Generate valid C# for specializations in default args
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
8a75cee99f
Generate valid C++ for pure implemented dtors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
50feab050f
Free returned by value instances, not object ones
...
This was a dangerous bug by as the object remained in a deleted state to be used later.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
e2d0dce8ba
Generate valid C# for forwarded specializations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
c36145b29d
Bind default constructors with dependent pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
2fdd0822d2
Generate valid C# for setters returning Booleans
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
8803ede83d
Place returns as needed without an extra block
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4d4505e334
Generate valid C# for default params in specialisations
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
0255eb732d
Resolve overloads with typedef-ed mapped params
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
fe68d33cb4
Generate C++ deconflicted with system functions ( #1626 )
...
If a type shares a name with a system function, such as, well, "system()", declaring the type by name alone is taken as the function. So we need to prefix the type with "class" or "struct" as appropriate.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
7ead6b4574
Don't print tags for nameless and typedef classes
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
065ed82d2e
Remove the repetitive field for a type printer
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
c6768bcac5
Fix C4099 (class as struct) in generated C++/CLI
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
8d8c67d3a4
Bind the tag kind (struct, class, enum) of a type
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
81493b5936
Regenerate the parser bindings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
77e9d0cc75
Ignore a test which only fails with the Linux CI
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
6a0bdc1ba6
Delete the C++ copy when returning by value ( #1623 )
...
Fixes https://github.com/mono/CppSharp/issues/1600 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
1d162eb287
Delete the longer needed patching of msvc headers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
99a1457487
Don't evaluate dependent variables
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
5c8e598775
Delete the longer needed patching of msvc headers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
34b08efec6
Update LLVM to the latest version
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
strentler
f3fa7eb9ef
Fix for "vector subscript out of range" exception ( #1621 )
...
- The Visual Studio C++ compiler does not allow to access Headers[i+1]
when i+1 points past the last element.
Doing so raises an exception when in
debug mode
Co-authored-by: Christian Kolek <Christian.Kolek@teamviewer.com>
4 years ago
João Matos
37103805d9
Update UsersManual.md
4 years ago
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