Dimitar Dobrev
f44686bda0
Generate valid C++ for redeclaration of friends
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
eca0db1765
Generate valid C++ for protected inline functions
...
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
3aab30f572
Add built-in compilation of extra symbols
...
Fixes https://github.com/mono/CppSharp/issues/1456 and https://github.com/mono/CppSharp/issues/1253 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
49122e0d62
Generate valid C++ for protected ctors of pure classes
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
8a75cee99f
Generate valid C++ for pure implemented dtors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Dimitar Dobrev
fe68d33cb4
Generate C++ deconflicted with system functions ( #1626 )
...
If a type shares a name with a system function, such as, well, "system()", declaring the type by name alone is taken as the function. So we need to prefix the type with "class" or "struct" as appropriate.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
4 years ago
Joao Matos
eed362841c
Introduce a scope kind stack for type printers.
...
Just like we already have for other context data.
5 years ago
Dimitar Dobrev
86835469ac
Generate valid C++ for pointers in template args
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
85b6a92861
Generate valid C++ for protected constructors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
d741ced55a
Generate valid C++ for protected destructors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
1020e18bdc
Only implement abstract classes in C++ for ctors/dtors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
da7dd1b674
Export symbols for indirectly accessible constructors
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
0fd4307b81
Generate C++ for constructors of abstract types
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
b6811060ab
Make the CPP ABI visible only to the STD symbols
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
257b347fbd
Regenerate the parser bindings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
68146058f3
Generate valid C++ for destructors of nested types
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
60474c922c
Call the destructor instead of deleting the object in the generated symbols
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
josetr
3ffa42aa2f
Fix generated constructor cant use `placement new` when class overloads `operator new` ( #1431 )
5 years ago
Dimitar Dobrev
d0216f1e7d
Ignore type maps when printing C++ for symbols
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
João Matos
083bcd845c
Make sure we use a native type printer for symbols code generation.
5 years ago
João Matos
55a31b05bf
CppTypePrinter now takes a BindingContext for further usage in type maps handling.
5 years ago
Dimitar Dobrev
37d391bdac
Ensure generated symbols can use placement new
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 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
Dimitar Dobrev
403440dac2
Ignore unused destructors when generating symbols
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
abf219b019
Fix compile warning for unused variable.
6 years ago
Dimitar Dobrev
07b9e4ca10
Force compilation of all functions of specializations
...
Functions of template specializations can have their symbols compiled by having their addresses taken just like regular functions. This way we take just the necessary symbols compared to exporting entire templates which both compile useless symbols and skip actually needed ones.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
b94a89b3ec
Give unique names to exported inlined functions
...
This way a precise exception is thrown when the birdge tries calling into a wrong version of the library with exported symbols.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Alexander Ovchinnikov
2c14b91301
Fix the generated C++ for Xcode 10.2
...
Fixes https://github.com/mono/CppSharp/issues/1203
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
579df276e4
Add `ScopeKind` to base `TypePrinter`.
7 years ago
Joao Matos
6dfd16ba9b
Move `CppTypePrinter` to generators and inherit from `TypePrinter`.
7 years ago
Dimitar Dobrev
38844e5e23
Fixed a regression which made inlines uncompilable.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
32da859711
Exported all additional symbols on macOS.
...
Many functions in libc++ are marked with _LIBCPP_INLINE_VISIBILITY. This means they are only exported when actually used. This is why exporting just the templates themselves failed to export their functions but listing the functions themselves worked. We need to define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS to have the functions always exported.
We use _LIBCPP_VERSION to detect if we use libc++ i.e. Clang's standard C++ library.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
88f118ec4e
Fixed the parsing of functions with integral template args.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
14080382e4
Fixed the generated C++ for symbols when protected classes need them.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
b22abfc80b
Removed the possibility for conflicts between overloads when generating C++ for symbols.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
3dba1eb594
Exported entire specialisations when they only have valid functions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
af8a758744
Fixed the generated C++ for symbols to be compatible with Clang.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
9b0e0ba611
Fixed the generation of inlines to handle types in classes in name-spaces.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
422b98a0fd
Enabled the tests for std::string.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Mohit Mohta
b4462274c2
Added exporting of std-symbols ( #862 )
8 years ago
Dimitar Dobrev
991a891563
Ensured symbols for system functions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
1174800cff
Generated the symbols for templates by separate functions instead.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
ac83eed80a
Exported template specialisations in the native symbols.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
38f247b1db
Merged the libraries for inlines and templates into one.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
7ad1af0cac
Removed redundant qualification of types in the generated C#.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Dimitar Dobrev
6f367e1af4
Changed the convention of inlined constructors and destructors to C.
...
This is necessary so that they match the C++ functions which wrap their native counterparts.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
9 years ago
Joao Matos
04ee2e5b7d
Rename CodeGenerator.Templates to Outputs.
9 years ago
Dimitar Dobrev
87a75e3acd
Changed the generation of C++ for inlines not to rely on -fkeep-inline-functions.
9 years ago