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
josetr
eb5031bf4c
Format files
3 years ago
Dimitar Dobrev
5e328da9e7
Fix C# layouts for classes with nameless unions
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
c8c415b977
Generate valid C# for static object-typed fields
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
722a1d735d
Generate valid C++ for conversion operators in name-spaced classes
...
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
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
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
Dimitar Dobrev
1209f1af42
Test C++11 in-class member initializers
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
4405525f3a
Make unit tests independent of the generator
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
josetr
c32ac59988
Prevent string destructor from being called twice when its passed by value ( #1455 )
5 years ago
josetr
a3e7282a85
Fix CI build by temporarily disabling a test ( #1442 )
5 years ago
Dimitar Dobrev
b5ca0635be
Check symbols in tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
28a5c5d76c
Prioritize public non-field properties when resolving naming conflicts
...
Fixes https://github.com/mono/CppSharp/issues/1175 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
b7fa720ee1
Generate valid C# for constructors taking const&
...
Fixes https://github.com/mono/CppSharp/issues/1119 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
6dcb2ac31a
Generate valid C# for returned function pointers
...
Fixes https://github.com/mono/CppSharp/issues/1226 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
a1ddbd82d7
Expose returned values of non-void setters
...
Now we generate them as methods too.
Fixes https://github.com/mono/CppSharp/issues/960 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
dcd11e9433
Ensure enumerations lack conflicts when renamed
...
Fixes https://github.com/mono/CppSharp/issues/965 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
2acbf32a96
Fix generation for fields of type const reference
...
Fixes https://github.com/mono/CppSharp/issues/1323 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Ali Alamiri
c23ef39bca
Marshal pointer to primitive typedefs in C++/CLI ( #1355 )
...
Co-authored-by: Build Agent <admin@sage.com>
5 years ago
Dimitar Dobrev
54c6159f35
Fix naming conflicts with nested types and members
...
Fixes https://github.com/mono/CppSharp/issues/1353 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
64b1efd1e7
Generate valid C# for parameters typedef-ed to mapped types
...
Fixes https://github.com/mono/CppSharp/issues/1256 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Ali Alamiri
e0b8b58836
Handle pointer to pointer param ( #1343 )
...
Generate valid C++/CLI for passed pointers to pointers
Co-authored-by: Build Agent <admin@sage.com>
5 years ago
Dimitar Dobrev
8dfcd5b717
Fix all memory leaks in tests
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
653f4cc287
Generate by ref parameters of type a pointer to enum
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Ali Alamiri
3547203538
Marshal non primitive fixed arrays. ( #1311 )
...
Marshal non primitive fixed arrays.
5 years ago
João Matos
40ca6f281a
Fix bug related to processing of potential property methods.
...
Fixes https://github.com/mono/CppSharp/issues/1291 .
5 years ago
Dimitar Dobrev
ed6f8f1f96
Fix comparison of char and const char* in overloading
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
0e0513feaa
Fix regressed overloaded potential setters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
51978ad4c4
Restore writeable properties starting with verbs
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
e11057d71d
Fix regressed virtual read-only properties with setters in subclasses
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
9d365a6b9a
Restore mapping of two properties of the same name save for a prefix
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
d2ebabbebe
Restore mapping of overloaded getters to methods
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
914b977dfd
Optimize the pass for 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
547a9f2819
Fix the passing of std::string by value
...
std::string has a non-trivial copy constructor which was erroneously ignored.
Fixes #867 .
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
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
ce3d5d572a
Generate valid C# when a function is named "get<number>"
...
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
Joao Matos
76ef6b046e
Add a test for passing by value of structs with copy ctors.
6 years ago
Dimitar Dobrev
9cad9462e2
Fixed ambiguous code when a nested type and a property-like method with overloads have the same name
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
aad3b7f186
Fixed the renaming of properties with the same name as their owners.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
bc7f20a10a
Fixed the generated C# when an instance method has a parameter named "instance".
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
b966bd6798
Fixed the generated C# for const/non-const overloads with > 1 param.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
5df67cd0c7
Fixed the generation for parameters of type void**.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
b0db304523
Fixed overloading of operators with parameters mapped to the same type.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a65f91949c
Handled int and long in maps to help resolve ambiguity.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
4adc3d646a
Fixed right-value references creating ambiguous overloads.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago