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>
- 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>
* 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.
* 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
* 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.
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.