diff options
| author | Paul Joannon | 2018-03-03 20:25:21 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-14 23:54:11 +0200 |
| commit | d02c891a4b00dbd916b9e2642eae95a53a6c5552 (patch) | |
| tree | 1d6395c7eac12e8d0988e0a0c67a3c85f119b237 /modules | |
| parent | 3bd414786caffd650cf0ced637fd674d8fa3d8cd (diff) | |
| download | godot-d02c891a4b00dbd916b9e2642eae95a53a6c5552.tar.gz godot-d02c891a4b00dbd916b9e2642eae95a53a6c5552.tar.zst godot-d02c891a4b00dbd916b9e2642eae95a53a6c5552.zip | |
[mono] write classes with no constructor as abstract
(cherry picked from commit ef5672d3f94a7321ed779c922088bb72adbb1521)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 315c1e2f1..a210b8e48 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -103,7 +103,7 @@ #define C_METHOD_MANAGED_TO_DICT C_NS_MONOMARSHAL "::mono_object_to_Dictionary" #define C_METHOD_MANAGED_FROM_DICT C_NS_MONOMARSHAL "::Dictionary_to_mono_object" -#define BINDINGS_GENERATOR_VERSION UINT32_C(1) +#define BINDINGS_GENERATOR_VERSION UINT32_C(2) const char *BindingsGenerator::TypeInterface::DEFAULT_VARARG_C_IN = "\t%0 %1_in = %1;\n"; @@ -730,7 +730,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str } output.push_back(INDENT1 "public "); - output.push_back(itype.is_singleton ? "static class " : "class "); + bool is_abstract = !ClassDB::can_instance(itype.name) && ClassDB::is_class_enabled(itype.name); // can_instance returns true if there's a constructor and the class is not 'disabled' + output.push_back(itype.is_singleton ? "static class " : (is_abstract ? "abstract class " : "class ")); output.push_back(itype.proxy_name); if (itype.is_singleton) { |
