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
Joe Hull
748b7b5d03
Add a mechanism to selectively initialize allocated unmanaged memory in the default constructor.
...
* 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
4 years ago
Joe Hull
03bf194b63
Enhanced ExpressionEvaluator to return implicitly typed uint, long, and ulong values from EvaluateNumber when there is no literal type suffix applied to a numeric expression string.
...
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.
4 years ago
josetr
0b270df006
Rename files
5 years ago
Joao Matos
80a83ceada
Be more strict when constructing a regex for parsing macros.
5 years ago
Dimitar Dobrev
c23bc89f86
Clean all warnings in the non-generated C#
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
c0510730f0
Prefer non-mapped types when resolving ambiguous overloads
...
This fixes a missing specialized method when it has a parameter with type a mapped template which is ignored when dependent.
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
d5380fe890
Fix the generated C# for const char*&
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6e78b4df15
Fix the generated C# when type arguments are mapped the same
...
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
efa11ab745
Simplified type maps by unlinking them from declarations.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a4913509eb
Added type maps for primitive strings (pointers to char).
...
const char*, const char16_t* and const wchar_t* in particular.
This enables comparison of types when resolving ambiguity.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
e10fc01bff
Changed type maps to only return types - no strings.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
8c394afd86
Simplified a type map in the tests.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
TheLastRar
430bbdb257
Evaluate expressions for enums generated using GenerateEnumFromMacros ( #1048 )
...
* Evaluate expressions when generating enum from macros
ExpressionEvaluator taken from https://github.com/codingseb/ExpressionEvaluator
* Set namespace for enums generated from macros.
* Add Tests
7 years ago
Dimitar Dobrev
fceb204a98
Fixed the generated C# for members of types nested in templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Rokas Kupstys
4e735b5b61
Test for consistent struct/class keywords.
...
Tests for cases where class name matches translation unit name.
Tests for cases where global constants/functions from different translation units would end up in the value type.
8 years ago
Dimitar Dobrev
caacaa841f
Worked around duplication of types nested in templates and forwarded.
...
Since all template specialisations are incomplete by default, so are classes nested in them. When such classes are also forwarded, there are two incomplete declarations with the same name and in the same scope. Our parser searches by name and completion and it can therefore not make a difference between the two. Consequently, it always returns the first type it finds even if it isn't the right one. When clang::Sema later completes the specialisations, it completes the nested types too which leads to two identical complete types in the same scope.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
4bfece6ab9
Fixed the generated C# for specialisations with an ignored specialisation as an arg.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
ae6a37359a
Removed unused STD enumerations from generation.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
23e7dec1f5
Made the generation of templates optional and off by default.
...
Templates are still experimental and we don't have automatic compilation of C++ symbols so it's risky to always have them enabled.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
cd548059e9
Added support for class templates which do not specialise types external to them.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Gilad Levi
9425beab96
added a test for MyMacroTestEnum + split LINQ to different lines
8 years ago
Gilad Levi
35adf99165
added test for asci-macro-enum feature
8 years ago
Joao Matos
38cb8e1dbe
Overhaul type printer and marshal contexts design and implementation.
...
The goal is to simplify the design and get rid of useless type printer contexts inside type printers.
8 years ago
Gilad Levi
5302f5870c
Use fixed c# statement when accessing fixed struct members
8 years ago
Joao Matos
c4edb58881
Re-order declarations in CSharp test generator.
8 years ago
Dimitar Dobrev
8b230bdf07
Fixed a corner case of a default parameter with a type mapped to an enum.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Joao Matos
3629eead5d
Rename CSharpMarshalKind to MarshalKind and move it to Marshal.cs.
8 years ago
Joao Matos
5d19f22d4c
Unify CSharpTypePrinterContextKind with TypePrinterContextKind.
8 years ago
Dimitar Dobrev
ef69bf1b95
Made the case-renaming pass non-optional for Mono/.NET generators.
8 years ago
Joao Matos
1371f89957
Convert CheckMacroPass to be a default pass.
8 years ago
Dimitar Dobrev
b2a872f431
Merged the passes for properties and made the result non-optional.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
bc9016cf19
Made the generation of conversion operators for constructors non-optional.
...
We are better off always having them because we map to C++ better this way.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
ad5505f113
Enabled multiple inheritance, and removed its option, in the C# generator.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Joao Matos
7a26c11382
Rename VisitLibrary method to VisitASTContext.
9 years ago
Dimitar Dobrev
b2a90a5d80
Prefixed the internal structure for the C# end to avoid naming conflicts.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
4f10e9fb78
Fixed the build after the refactoring.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
4df66454b1
Enabled cleaning up in type maps and used it to dispose of used std::string objects.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
f197aada99
Made the C# end always generate one file per module.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
f7707629ef
Fixed the getting of values mapped to enums, from pointers.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
d14ad944fc
Fixed the type map for an enum to also handle pointers.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
0d5c4539a2
Generated internals of types nested in templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
48fece6aa1
Revert "Threw an exception when there are parsing errors, and handled it in the test clients."
...
This reverts commit 01e872b30d
.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
01e872b30d
Threw an exception when there are parsing errors, and handled it in the test clients.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
477dd914cb
Fixed setters of indexers when the key is type-mapped.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
10 years ago
Dimitar Dobrev
54e8a16fd1
Reverted the representation of Booleans as managed Booleans except in internal structs.
...
Managed booleans are more CPU-efficient than bytes, and some problems with code generation are fixed.
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
Dimitar Dobrev
b9e3efbf0c
Removed the option for copy ctors and prevented usage of ignored ones.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
10 years ago
triton
5ef899366c
Renamed the test suite projects.
10 years ago