João Matos
40119222c1
Default to .h file extension in C code generator.
5 years ago
João Matos
c19df0cc64
Minor refactoring fixes.
5 years ago
João Matos
ae47fd73bc
Re-use common C++ declaration type printing code in CLITypePrinter.
5 years ago
João Matos
c89d427bf2
Minor refactorings in CppTypePrinter.cs.
5 years ago
João Matos
fd914fa282
Allow changing the default TypePrinterContextKind when creating a type printer.
5 years ago
João Matos
c88ddcc60d
Refactor CLITypePrinter.cs to use string interpolation.
5 years ago
Dimitar Dobrev
6fe81fddcc
Remove needless pointer offsets from generated C#
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
d3a3484c35
Fix a crash for secondary bases with secondary bases
...
The test has also uncovered a bug where the call to a primary base isn't always adjusted so the fix is extended accordingly.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
9337004bb6
Simplify and optimize the printing of pointers in C++
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
e4ac492560
Fix printing of function pointers in C++
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
c5bcb48cc2
Implement UnresolvedUsingType and UnresolvedUsingTypename.
...
Fixes https://github.com/mono/CppSharp/issues/1235 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
4a4c919fb3
Extend printing and reading of exception types
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
16bfc67a9a
Fix the check to ignore dependent name types
...
The bug used to break the parser bindings for macOS since std::string uses a dependent name type for its necessary methods.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
8fd6ea1863
Fix the printing of "noexcept" in C++
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c62f85bfa8
Delete a custom pass added as standard
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
f737ad6c00
Fix the C++ printing of function pointers in parameters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
8459cabce9
Fix printing of type defs in C++
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9aa8ad3f55
Remove the internal C# functions for virtual destructors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
e26206ffc7
Make the pass for properties more extendable
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
d986132743
Split generation from addition of properties
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9ea4289f15
Simplify overrides of overrides of secondary bases
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
65b17fc958
Optimize calls to base getters in properties
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
499ecc3b89
Simplify searching for base properties
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
b12acfcce7
Upgrade ANSI marshalling to UTF-8 marshalling
...
UTF-8 is backwards-compatible with i.e. a strict superset of, ANSI, so we can safely marshal any ANSI as UTF-8 and thus we gain UTF-8 support for free.
Also fixed leaking memory when passing strings to native code as nobody ever freed the previously used Marshal.StringToPtr.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c6ffa9ddf2
Fix the regressed indentation of printed comments
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a0da3b37b1
Simplify the generated C# for marshalling strings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
1792f529ff
Fix the getting of references to pointers in C#
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
62fc6f90d9
Fix the passing of references to pointers in C#
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
e430f6f8dc
Fix regressed indexers in templates with non-trivial ctors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
fac861ad8d
Make indexers use non-trivial copy ctors if any
...
Fixes #1229 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
d90d3283e4
Generate with no hacks correctly sized layouts
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
153a4d095b
Guard against null for objects passed by value
...
Fixes #1228
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
3cd7fdee25
Generate valid C# for implicit conversion to const char*
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
f810ca63b2
Generate valid C# when passing a const ref to char
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
2919dfddbd
Generate valid C# when a method from a secondary base has no native symbol
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
991c6ffb25
Generate valid C# for typedef-ed type parameters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6b744458b4
Flatten anonymous types to avoid empty names
...
This improves our generated API as we no longer need "_0"-like names and also prevents conflicts between an anonymous type and a property of this type.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
1fc1b4ec51
Fix default arguments to only map to null if pointers
...
This bug is revealed by properly fixing the reading of ABI parameters in the parser.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
458293edfc
Generate valid C# for returned const void pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9e21bcd022
Fix regressions with void pointers and references
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
43c17f9946
Generate valid C# for r-values to void pointers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
fce2841a21
Generate valid C# when a field with an anon type starts with '$'
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
53816286bc
Fixed type map support for typedef types.
...
Fixes https://github.com/mono/CppSharp/issues/1205 .
6 years ago
Dimitar Dobrev
39d5828b64
Fix a regression with headers named after keywords
...
Fixes https://github.com/mono/CppSharp/issues/1212 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a9bfe1c31f
Support indirect parameters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6b3cdaffb7
Optimize renaming of declarations named after keywords
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
AlexR
82e41d3601
Fix a crash when a function pointer takes a function pointer
...
Fixes https://github.com/mono/CppSharp/issues/1144
6 years ago
Dimitar Dobrev
0e56bc62e2
Generate valid C# for returned const char*&
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9bc39c44ab
Generate valid C# for template indexers taking const char*
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
3caa8c5da2
Restore removed specializations
...
All specializations which only use pointers as their type arguments need at most one internal representation since pointers are mapped to IntPtr. This was achieved by removing the unneeded specializations from their containing list. This was, however, a bug because specializations were thus removed not only as internal structures but in their entirety.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago