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
Dimitar Dobrev
202ae75df4
Fixed the generated code in a case of ambiguous overloads.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a240827d54
Added a test for passing an std::string by value.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
41b22762a4
Fixed the marshalling of std::string with GCC 6+ on Linux.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
3917ca2584
Fixed renaming when items of an enum only differ by case.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Matthew Albrecht
f8ccbb80c0
Added parameter index to managed marshal variables
7 years ago
Rokas Kupstys
d8b53721ef
Fix for #1043 ( #1044 )
...
Field property getter returns non-value types by reference instead of by copy.
Fixes #1043
* Minor code clarity cleanup in GenerateFieldSetter. No behavior changed.
* Fix incorrect code generated in some cases.
* Test for fields getters returning references.
8 years ago
Dimitar Dobrev
67b241d95b
Added support for 16-bit wide characters (char16_t).
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
8cc67420d5
Fixed a crash when passing null as an std::string on Unix. ( #1012 )
...
Fixed a crash when passing null as an std::string on Unix
8 years ago
Dimitar Dobrev
046c428852
Fixed the binding of multiple identical function pointers with a calling convention.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Mohit Mohta
8a2e813445
Merged Delegate Pass and pass for Anonymous Delegates and added the following improvements alongwith.
...
1. Got rid of Anonymous Names.
2. Merged the common code for Delegate Generation.
3. The delegate pass also works for C++/CLI now.
4. Fixed the calling conventions of delegates for both, C++/CLI and C#.
5. Ensures that if a delegate is used for a virtual as well as something else, it finally ends up as public.
6. Fixed the code generation when the return type of a method is a function pointer that has been used somewhere else as well.
7. Added Access and Calling convention to the delegate definition.
The only thing left is to get rid of the hack used, i.e move the code in VisitFunctionDecl to VisitParametersDecl. Somehow, it's not working right now.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
973fdafdfe
Generated properties from setters returning Booleans.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
f33b162f6f
Ignored inlined name-spaces in the C# gen only.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Joao Matos
09e568d0b3
[generator] Improved processing for C++ inline namespaces.
8 years ago
Dimitar Dobrev
a056659d09
Generated properties from <type> get()/void get(<type>) pairs.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
f9a8798b8f
Fixed the generated C# for setters with a reference to a primitive type.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago