Dimitar Dobrev
c4b48cf185
Fixed some problems with arrays of void after mapping void* to IntPtr.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
11 years ago
Dimitar Dobrev
30cb2cbe85
Fixed an ambiguity between an internal ctor and a potential wrapped one.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
11 years ago
Dimitar Dobrev
0e8a6e368c
Moved the code for creating a ref object by value from the marshalling printer to a valid ctor by value.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
dddd165001
Fixed the generation of a null check before returning a value.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
a7d0ef13f9
Removed a needless renaming of parameters.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Tom Spilman
7e8f743228
Fixed const char string CS_IN_OUT case.
12 years ago
Tom Spilman
d4e4aaffad
Fixed CLI and CSharp support for out parameter const char strings.
...
Added test for out parameter const char strings.
12 years ago
Tom Spilman
47e7e68c12
Fixed IsInOut primitives to correctly pass the input value to the native code.
12 years ago
Tom Spilman
f60d267168
This fixes out or in/out enum parameters to generate correctly.
12 years ago
Tomi Valkeinen
7289a06b9e
Rename PrimitiveType Int32 and UInt32 to Int and UInt
...
As enum PrimitiveType is supposed to represent C++ types, having Int32
and UInt32 there is not correct.
This patch renames those values to Int and UInt.
This doesn't change the behavior, but makes it clearer that the types
for 'int' and 'unsigned int' are not necessarily 32 bits.
12 years ago
Tomi Valkeinen
c702e928e8
Rename PrimitiveType Int64 and UInt64 to LongLong and ULongLong
...
As enum PrimitiveType is supposed to represent C++ types, having Int64
and UInt64 there is not correct.
This patch renames those values to LongLong and ULongLong.
This doesn't change the behavior, but makes it clearer that the types
for 'long long' and 'unsigned long long' are not necessarily 64 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
12 years ago
Tomi Valkeinen
065570de74
Rename PrimitiveType Int16 and UInt16 to Short and UShort
...
As enum PrimitiveType is supposed to represent C++ types, having Int16
and UInt16 there is not correct.
This patch renames those values to Short and UShort.
This doesn't change the behavior, but makes it clearer that the types
for 'short' and 'unsigned short' are not necessarily 16 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
12 years ago
Tomi Valkeinen
1cd9f0a16c
Remove PrimitiveTypes Int8 and UInt8
...
As enum PrimitiveType is supposed to represent C++ types, having Int8
and UInt8 there is not correct.
This patch removes those values. As Int8 and UInt8 were set to be
equivalent to Char and UChar, we can just change all references to Int8
and UInt8 to Char and UChar.
This doesn't change the behavior, but makes it clearer that the types
for 'char' and 'unsigned char' are not necessarily 8 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
12 years ago
Tomi Valkeinen
3902dd4acc
Add PrimitiveTypes Long and ULong
...
The enum PrimitiveType represents, according to the comment, "the C++
built-in types.". However, it does not contain values for C++'s "long"
or "unsigned long", and the parser converts long to int. This is not
correct, and is a problem with 64bit support.
This patch adds Long and ULong values to PrimitiveType, and adds those
to all the switch-cases all around the code. For now Long and ULong are
handled exactly like Int and UInt, so this patch does not change
behavior.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
12 years ago
triton
eb2bbba883
Added better support for nullptr_t types.
12 years ago
marcos henrich
de764599fa
Separated IsTagDecl into TryGetClass and TryGetEnum, added IsClass() and IsEnum().
12 years ago
marcos henrich
3f96bdbfe3
Replaced declaration IgnoreFlags by GenerationKind. Added methods IsInternal and IsDeclared to declaration. Replaced IsGenerated = true by GeneratioKind = GeneratioKind.Internal. Deprecated Ignore, replace Ignore set by ExplicityIgnored, replace Ignore get by IsGenerated, IsInternal or IsDeclared.
...
Conflicts:
src/Generator/Passes/CheckOperatorsOverloads.cs
12 years ago
triton
2ebce723ae
Use SafeIdentifier when writing parameter names in the C# marshaller.
...
TODO: There are still lots of instances in the marshaller where we do not do this. We should instead clean the parameter/declaration names before entering generation.
12 years ago
triton
5e0cd3112a
Fixed marshaling of wide characters in the C# backend.
12 years ago
triton
fec8b00d8e
Added marshaling of function types to C# backend.
12 years ago
triton
21efb8fc83
Fixed a bug by removing this weird looking code from the C# marshaller.
...
The test suite still passes too.
12 years ago
triton
08255907de
Fixed C# and CLI backends to check for null values when marshaling classes.
12 years ago
Øystein Krog
d3e963ff19
Move helper methods in Type out from class and into extension class TypeExtensions
12 years ago
Dimitar Dobrev
99849da1d1
Added preliminary support for char16 to avoid crashes because of null parameter types.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
85e56de487
Applied Helpers.SafeIdentifier in the name-cleaning pass in order to get correct names in type maps.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
d92bc31a71
Replaced a call to == with ReferenceEquals when checking for null to avoid cycles in == operators.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
fe6378a88a
Added an additional property to type maps indicating if they actually provide marshalling (useful if only copy constructors are replaced).
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
cfeed2619a
Extended type maps with the ability to insert custom code instead of a copy ctor invocation.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
4c5d933cd2
Added support for marshalling arrays of pointers to primitives.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
aa5b66a4ab
Wrapped fields of structures with properties.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
227e592c1a
Improved the marshalling of arrays.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
triton
62f81e16f1
Reworked pointer marshaling in C# and CLI.
...
We are now more consistent between backends, specifically we need to make sure
to avoid directly visiting the desugared type since we might lose type maps when
handling typedefs.
12 years ago
triton
c8b0f515b3
Fixed parsing and marshaling of dependent declarations.
12 years ago
Dimitar Dobrev
8a502835f7
Added a check for 'null' before getting the native pointer of a wrapped object.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
acbdf7d82a
Added a test for fixed arrays which showed that setting actually worked incorrectly.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
275b4a1696
Filled in the setting of a fixed array.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
80dca38041
Filled in the returning of a fixed array.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
12 years ago
Dimitar Dobrev
07beb47048
Converted return types to their complementary interfaces, if any.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
1962751cb8
Stored the original class in its interface replacement used with multiple inheritance.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
3a9eef1e80
Added a new pass converting all parameter types to their respective interfaces, if any.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
5d308dc7c3
Fixed the generation of calls to members of nested classes.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
6edc1ac19b
Marshalled pointers to primitive types as such instead of using IntPtr.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
b82aebab3a
Added support for writing using indexers.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
triton
66ef3c55ff
Reworked support for out parameters in both backends and added a test.
13 years ago
Dimitar Dobrev
f38fa134e4
Added an option for an encoding.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
de4879f108
Added support for Unicode when marshalling strings.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
19cb1f5470
Added an off by default option for generating abstract implementations because the MS ABI branch does not always work.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
da6887ff07
Fixed the allocation of internal abstract implementations, and fixed their constructors to take a pointer to the abstract type.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
6d2c0eaed8
Generated internal implementations of abstract classes in a new pass.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago
Dimitar Dobrev
0f5e27f939
Fixed a bug that caused the generation of the uncompilable expression "&*IntPtr".
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
13 years ago